Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

broken global argument handling with Dockerfile.base #350

Closed
andreasvoigt opened this issue Apr 15, 2022 · 4 comments
Closed

broken global argument handling with Dockerfile.base #350

andreasvoigt opened this issue Apr 15, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@andreasvoigt
Copy link

Describe the bug
Docker has a specific way to handle globally defined ARGs (ARGs above a FROM stage). Those globally defined ARGs can be reused in several FROM blocks. E.g. if you want to use ARGs which are defined in the Dockerfile.base, you can reuse them in the package specific Dockerfiles via redefinition. But those definitions will be eleminated via lerna-dockerize.

Example Dockerfile.base

# This is the base stage, which prepares the project for further builds with lerna-dockerize.

# global arguments
ARG AWESOME_ARG=test

FROM node:12-slim
ARG AWESOME_ARG

RUN echo "varibale content: $AWESOME_ARG"
# do other stuff

To Reproduce
Steps to reproduce the behavior:

  1. add a block with a ARG definition above the FROM command in within the Dockerfile.base
  2. run npm run lerna-dockerize in you project
  3. see the compiled output --> your defined ARG does not exist in the output file

Expected behavior
The globally defined ARG should be taken into the output file.

Desktop (please complete the following information):

  • OS: Linux

Additional context
See further information about ARG handling in docker documentation: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact

@andreasvoigt andreasvoigt added the bug Something isn't working label Apr 15, 2022
@rudxde rudxde closed this as completed in 9427d3f Apr 15, 2022
@rudxde rudxde reopened this Apr 15, 2022
@rudxde
Copy link
Owner

rudxde commented Apr 15, 2022

Hi @andreasvoigt ,
can you check if the issue is resolved in the current build version?

npm i --save-dev lerna-dockerize@build

@andreasvoigt
Copy link
Author

Good morning!
The patch works. Thank you very much!

@rudxde
Copy link
Owner

rudxde commented Apr 16, 2022

Will create an patch release soon

@rudxde rudxde closed this as completed Apr 16, 2022
@rudxde
Copy link
Owner

rudxde commented Apr 16, 2022

The fix is part of the release 0.9.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants