FROM node:18-alpine as base
WORKDIR /app
RUN env
# Install AWS-CLI
RUN apk add --no-cache aws-cli
# Copy and download dependencies
FROM base as with-source
COPY . .
RUN yarn setup
RUN yarn install --frozen-lockfile
FROM with-source as run
EXPOSE 4000
RUN yarn build
CMD yarn start
When running the CircleCI pipeline, the env is not what I would expected:
I would expect the env output in the docker container would report also the variables I have defined in the extra-build-args. The first two should have been taken from the CircleCI context while the last one is static but any of them is present in the ENV inside the docker image.
Orb version
8.1.3
Reference
https://github.com/CircleCI-Public/aws-ecr-orb/issues/192
What happened
If I use
extra-build-args
option in the config.yml, it seems the variables are never passed to the created container.In my CircleCI job I do the following:
In the
aws
context I have defined several variables including these:This is the Dockerfile:
When running the CircleCI pipeline, the env is not what I would expected:
Expected behavior
I would expect the
env
output in the docker container would report also the variables I have defined in theextra-build-args
. The first two should have been taken from the CircleCI context while the last one is static but any of them is present in the ENV inside the docker image.