Skip to content

Commit b4bd3d8

Browse files
committed
Fix docker DBSYNC_TAG build arg placement
1 parent bc28e5b commit b4bd3d8

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.github/workflows/docker-image.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13-
13+
outputs:
14+
tag: ${{ steps.get_latest_tag.outputs.tag }}
1415
steps:
1516
- name: Checkout repository
1617
uses: actions/checkout@v2
@@ -36,7 +37,7 @@ jobs:
3637
password: ${{ secrets.GITHUB_TOKEN }}
3738

3839
- name: Build and push Docker image
39-
uses: docker/build-push-action@v2
40+
uses: docker/build-push-action@v6
4041
with:
4142
context: .
4243
file: ./Dockerfile

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Step 1: Build Stage using musl to create a statically linked executable
1+
ARG DBSYNC_TAG
2+
23
FROM alpine:latest AS json_update
34

45
# Install necessary build dependencies, including autoconf and libtool
@@ -33,19 +34,18 @@ COPY ./json_merge/update_json.c .
3334
# Compile the C program statically using musl-gcc
3435
RUN gcc -o update_json update_json.c -ljansson -static
3536

36-
37-
37+
# Step 2: Config Stage to fetch environment files
3838
FROM ubuntu:24.04 AS config
3939
RUN apt-get update && apt-get install -y git \
4040
&& git clone --depth 1 --filter=blob:none --sparse --no-checkout https://github.com/input-output-hk/cardano-playground.git \
4141
&& cd cardano-playground \
4242
&& git sparse-checkout set docs/environments \
4343
&& git checkout
4444

45-
ARG DBSYNC_TAG=13.6.0.4
46-
47-
FROM ghcr.io/intersectmbo/cardano-db-sync:${DBSYNC_TAG:-13.6.0.4}
45+
# Step 3: Final Stage
46+
# Declare ARG before FROM to allow its use in FROM
47+
FROM ghcr.io/intersectmbo/cardano-db-sync:${DBSYNC_TAG}
4848
COPY --from=json_update /app/update_json /bin/update_json
4949
COPY --from=config /cardano-playground/docs/environments /environments
5050
COPY ./entrypoint.sh /
51-
ENTRYPOINT ["/bin/bash", "-e", "/entrypoint.sh" ]
51+
ENTRYPOINT ["/bin/bash", "-e", "/entrypoint.sh"]

0 commit comments

Comments
 (0)