Skip to content

Commit b076fe9

Browse files
committed
Testing docker image creation
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
1 parent 2961ab0 commit b076fe9

File tree

4 files changed

+50
-2
lines changed

4 files changed

+50
-2
lines changed

.github/workflows/docker-publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build-and-publish:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
SQRL_VERSION: [0.5.6, 0.5.7]
17+
18+
env:
19+
DOCKER_REPO: datasqrl/flink-jar-runner
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2
27+
28+
- name: Pull base images
29+
run: |
30+
docker pull gradle:8.6-jdk11
31+
docker pull flink:1.19.1-scala_2.12-java11
32+
33+
- name: Log in to Docker Hub
34+
uses: docker/login-action@v2
35+
with:
36+
username: ${{ secrets.DOCKER_USERNAME }}
37+
password: ${{ secrets.DOCKER_PASSWORD }}
38+
39+
- name: Build and push Docker image
40+
working-directory: flink-dockerfile-example
41+
run: |
42+
docker build --build-arg SQRL_VERSION=${{ matrix.SQRL_VERSION }} -t $DOCKER_REPO:${{ matrix.SQRL_VERSION }} .
43+
docker push $DOCKER_REPO:${{ matrix.SQRL_VERSION }}

fink-dockerfile-example/Dockerfile renamed to flink-dockerfile-example/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@
1616

1717
FROM gradle:8.6-jdk11 AS build
1818

19+
ARG SQRL_VERSION="0.5.7"
20+
1921
WORKDIR /app
2022

2123
COPY build.gradle /app/build.gradle
2224

25+
ENV SQRL_VERSION=${SQRL_VERSION}
26+
2327
RUN gradle --no-daemon --console=plain copyDependencies
2428

29+
RUN ls -lha /app/build/dependencies
30+
2531
FROM flink:1.19.1-scala_2.12-java11
2632

2733
RUN mkdir -p /opt/flink/plugins/flink-s3-fs-hadoop
2834
RUN ln -fs /opt/flink/opt/flink-s3-fs-hadoop-*.jar /opt/flink/plugins/flink-s3-fs-hadoop/.
2935

3036
COPY --from=build /app/build/dependencies /opt/flink/lib
31-

fink-dockerfile-example/build.gradle renamed to flink-dockerfile-example/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ext {
2727
flinkVersion = "1.19.1"
2828
jdbcVersion = "3.2.0-1.19"
2929
kafkaVersion = "3.2.0-1.19"
30-
sqrlVersion = "0.5.7"
30+
sqrlVersion = System.getenv('SQRL_VERSION')
3131
icebergVersion = "1.6.0"
3232
}
3333

0 commit comments

Comments
 (0)