Skip to content

Commit

Permalink
Fix Tag name in Dockerfiles (#78)
Browse files Browse the repository at this point in the history
* fix tag name in dependent images

* fix build args
  • Loading branch information
benlee0423 authored Jan 11, 2024
1 parent dca9bbb commit 6692395
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/action_templates/build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ runs:
with:
context: ./docker
file: ./docker/${{ inputs.dockerfile-name}}
build-args: |
TAG_NAME=${{ env.TAG_NAME}}
push: true
platforms: linux/arm64
tags: |
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
################################################################################################################
################################################################################################################
##### Penultimate stage for image
FROM awiciroh/ngen as rocky_build_staging
ARG TAG_NAME
FROM awiciroh/ngen:${TAG_NAME} as rocky_build_staging

ARG DATASET_DIRECTORIES

Expand Down
16 changes: 10 additions & 6 deletions docker/Dockerfile.ngen
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ ARG NGEN_BUILD_CONFIG_TYPE="Release" \
REPO_URL=https://github.com/NOAA-OWP/ngen.git \
BRANCH=master \
COMMIT \
WORKDIR=/ngen
WORKDIR=/ngen \
TAG_NAME


################################################################################################################
################################################################################################################
##### Create intermediate Docker build stage for building framework in Rocky Linux environment
FROM awiciroh/ngen-deps:latest as rocky_init_repo
FROM awiciroh/ngen-deps:${TAG_NAME} as rocky_init_repo
ARG REPO_URL \
BRANCH \
COMMIT \
Expand Down Expand Up @@ -39,16 +40,19 @@ RUN cd ${WORKDIR} \

################################################################################################################
################################################################################################################
FROM awiciroh/ngen-deps:latest as rocky_ngen_build_testing
FROM awiciroh/ngen-deps:${TAG_NAME} as rocky_ngen_build_testing

COPY --chown=${USER} --from=rocky_init_repo ${WORKDIR}/ngen ${WORKDIR}/ngen
ENV BOOST_ROOT=${WORKDIR}/boost
WORKDIR ${WORKDIR}/ngen

# Make an alias for t-route with tag name
FROM awiciroh/t-route:${TAG_NAME} as troute

################################################################################################################
################################################################################################################
##### Create intermediate Docker build stage for building framework in Rocky Linux environment
FROM awiciroh/ngen-deps:latest as rocky_build_ngen
FROM awiciroh/ngen-deps:${TAG_NAME} as rocky_build_ngen

ARG REPO_URL \
BRANCH \
Expand All @@ -71,8 +75,8 @@ ARG REPO_URL \
BUILD_SLOTH="true"

COPY --chown=${USER} --from=rocky_init_repo ${WORKDIR}/ngen ${WORKDIR}/ngen
COPY --chown=${USER} --from=awiciroh/t-route:latest ${WORKDIR}/t-route/wheels /tmp/t-route-wheels
COPY --chown=${USER} --from=awiciroh/t-route:latest ${WORKDIR}/t-route/requirements.txt /tmp/t-route-requirements.txt
COPY --chown=${USER} --from=troute ${WORKDIR}/t-route/wheels /tmp/t-route-wheels
COPY --chown=${USER} --from=troute ${WORKDIR}/t-route/requirements.txt /tmp/t-route-requirements.txt
ENV BOOST_ROOT=${WORKDIR}/boost

USER root
Expand Down
9 changes: 6 additions & 3 deletions docker/Dockerfile.t-route
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
ARG TROUTE_REPO_URL=https://github.com/NOAA-OWP/t-route.git \
TROUTE_BRANCH=master \
TROUTE_COMMIT \
WORKDIR=/ngen
WORKDIR=/ngen \
TAG_NAME

################################################################################################################
################################################################################################################
##### Create intermediate Docker build stage for building t-route in Rocky Linux environment
FROM awiciroh/ngen-deps:latest as rocky_init_troute_repo
ARG TAG_NAME
FROM awiciroh/ngen-deps:${TAG_NAME} as rocky_init_troute_repo
ARG TROUTE_REPO_URL \
TROUTE_BRANCH \
TROUTE_COMMIT \
Expand All @@ -27,7 +29,8 @@ RUN cd ${WORKDIR} \
################################################################################################################
################################################################################################################
##### Create intermediate Docker build stage for building t-route in Rocky Linux environment
FROM awiciroh/ngen-deps:latest as rocky_build_troute
ARG TAG_NAME
FROM awiciroh/ngen-deps:${TAG_NAME} as rocky_build_troute

ARG REPO_URL \
BRANCH \
Expand Down

0 comments on commit 6692395

Please sign in to comment.