New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dockerfile "freeze" support by pinning ARG and ENV variables #508
Comments
I would like to work on this issue. |
The work for parsing the If the Dockerfile before the "freeze" looks like this:
We would want the resulting "frozen" dockerfile to look like this:
Note that ARG variables can be used in a variety of commands, not just
|
We can use |
That all sounds a little complicated for this functionality :) And we already have functionality in Tern that finds the commands that created each image layer. Why don't you start with this: for all of the
to this:
Does that sound good? |
Yes! |
Replace the arg varibles in the dockerfile. Work towards tern-tools#508. Signed-off-by: WangJL <hazard15020@gmail.com>
Replace the arg varibles in the dockerfile. Work towards tern-tools#508. Signed-off-by: WangJL <hazard15020@gmail.com>
Replace the arg varibles in the dockerfile if known. Work towards tern-tools#508. Signed-off-by: WangJL <hazard15020@gmail.com>
Replace the arg varibles in the dockerfile if known. Work towards tern-tools#508. Signed-off-by: WangJL <hazard15020@gmail.com>
Replace the arg variables in the dockerfile if known. Work towards tern-tools#508. Signed-off-by: WangJL <hazard15020@gmail.com>
Replace the arg variables in the dockerfile if known. In tern/analyze/docker/dockerfile.py, add function expand_arg which finds the defination of ARG variables and replace them using function replace_env. Add test dockerfile tests/dockerfiles/buildpack_deps_jessie_arg. Add a testcase in tests/dockerfiles/buildpack_deps_jessie_arg.: Work towards tern-tools#508. Signed-off-by: WangJL <hazard15020@gmail.com>
Replace the arg variables in the dockerfile if known. In tern/analyze/docker/dockerfile.py, add function expand_arg which finds the defination of ARG variables and replace them using function replace_env. Add test dockerfile tests/dockerfiles/buildpack_deps_jessie_arg. Add a testcase in tests/dockerfiles/buildpack_deps_jessie_arg.: Work towards #508. Signed-off-by: WangJL <hazard15020@gmail.com>
Fixed in 69f1b45 |
Replace the arg variables in the dockerfile if known. In tern/analyze/docker/dockerfile.py, add function expand_arg which finds the defination of ARG variables and replace them using function replace_env. Add test dockerfile tests/dockerfiles/buildpack_deps_jessie_arg. Add a testcase in tests/dockerfiles/buildpack_deps_jessie_arg.: Work towards tern-tools#508. Signed-off-by: WangJL <hazard15020@gmail.com>
Description
The goal of this task is to extract ARG and ENV build stage variables and pin them to the corresponding frozen Dockerfile. For example:
To Do
Research dockerfile-parse and see if it would be helpful to parse commands at all. There is some prototyping with it here: https://gist.github.com/joshuagl/2d30d79373f87858db9863d2a44d6150
Possibly re-write the
get_base_instruction
or create a new function intern/analyze/docker/dockerfile.py
and try to incorporate dockerfile-parse to get all the commands that we want to run plus theirARG
andENV
values.Super Issues
#454
The text was updated successfully, but these errors were encountered: