Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameterize jdk and nginx base images #11262

Merged
merged 3 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion airbyte-bootloader/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim
ARG JDK_IMAGE=openjdk:${JDK_VERSION}-slim
FROM ${JDK_IMAGE}

ARG VERSION=0.36.10-alpha

Expand Down
3 changes: 2 additions & 1 deletion airbyte-container-orchestrator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS sync-attempt
ARG JDK_IMAGE=openjdk:${JDK_VERSION}-slim
FROM ${JDK_IMAGE} AS sync-attempt

ARG DOCKER_BUILD_ARCH=amd64

Expand Down
3 changes: 2 additions & 1 deletion airbyte-metrics/reporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS metrics-reporter
ARG JDK_IMAGE=openjdk:${JDK_VERSION}-slim
FROM ${JDK_IMAGE} AS metrics-reporter

ARG VERSION=0.36.10-alpha

Expand Down
3 changes: 2 additions & 1 deletion airbyte-scheduler/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS scheduler
ARG JDK_IMAGE=openjdk:${JDK_VERSION}-slim
FROM ${JDK_IMAGE} AS scheduler

ARG VERSION=0.36.10-alpha

Expand Down
3 changes: 2 additions & 1 deletion airbyte-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS server
ARG JDK_IMAGE=openjdk:${JDK_VERSION}-slim
FROM ${JDK_IMAGE} AS server

EXPOSE 8000

Expand Down
3 changes: 2 additions & 1 deletion airbyte-webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM nginx:1.19-alpine as webapp
ARG NGINX_IMAGE=nginx:1.19-alpine
FROM ${NGINX_IMAGE} as webapp

EXPOSE 80

Expand Down
3 changes: 2 additions & 1 deletion airbyte-workers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim AS worker
ARG JDK_IMAGE=openjdk:${JDK_VERSION}-slim
FROM ${JDK_IMAGE} AS worker

ARG DOCKER_BUILD_ARCH=amd64

Expand Down
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,13 @@ def Task getDockerBuildTask(String artifactName, String projectDir, String build
return task ("buildDockerImage-$artifactName"(type: DockerBuildImage) {
def jdkVersion = System.getenv('JDK_VERSION') ?: '17.0.1'

def arch = System.getProperty("os.arch").toLowerCase()
def arch = System.getenv('BUILD_ARCH') ?: System.getProperty("os.arch").toLowerCase()
def isArm64 = arch == "aarch64" || arch == "arm64"

def buildPlatform = System.getenv('DOCKER_BUILD_PLATFORM') ?: isArm64 ? 'linux/arm64' : 'linux/amd64'
def alpineImage = System.getenv('ALPINE_IMAGE') ?: isArm64 ? 'arm64v8/alpine:3.14' : 'amd64/alpine:3.14'
def nginxImage = System.getenv('NGINX_IMAGE') ?: isArm64 ? 'arm64v8/nginx:1.19-alpine' : 'amd64/nginx:1.19-alpine'
def openjdkImage = System.getenv('JDK_IMAGE') ?: isArm64 ? "arm64v8/openjdk:${jdkVersion}-slim" : "amd64/openjdk:${jdkVersion}-slim"
def buildArch = System.getenv('DOCKER_BUILD_ARCH') ?: isArm64 ? 'arm64' : 'amd64'

inputDir = file("$projectDir/build/docker")
Expand All @@ -157,6 +159,8 @@ def Task getDockerBuildTask(String artifactName, String projectDir, String build
buildArgs.put('JDK_VERSION', jdkVersion)
buildArgs.put('DOCKER_BUILD_ARCH', buildArch)
buildArgs.put('ALPINE_IMAGE', alpineImage)
buildArgs.put('NGINX_IMAGE', nginxImage)
buildArgs.put('JDK_IMAGE', openjdkImage)
buildArgs.put('VERSION', buildVersion)
})
}
Expand Down