Skip to content
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 support for docker commit command #175

Open
miki725 opened this issue Jan 29, 2024 · 0 comments
Open

add support for docker commit command #175

miki725 opened this issue Jan 29, 2024 · 0 comments
Labels

Comments

@miki725
Copy link
Collaborator

miki725 commented Jan 29, 2024

Description

There are 2 ways to build an image in docker:

  • docker build ...
    
  • container=$(docker run ...)
    # do stuff in container
    docker stop $container
    docker commit $container <tag>
    

Currently chalk only supports first approach which adds chalk metadata to the built image. We should add support for doing something similar for the second case.

Result

Created images from running containers will be chalked which will include repo metadata/etc

Wrapping

The complexity will be how to make it work with entrypoint wrapping/etc. But that can be done with intermediate docker build internally:

container=$(docker run ...)
# do stuff in container
docker stop $container
chalk docker commit $container <tag>

# internally:
docker commit $container chalk-tmp
docker build . -f - < <(cat <<EOF
FROM chalk-tmp
COPY /chalk /chalk
...
EOF
)

This should allow to reuse all the logic from the docker build flow as well.

@miki725 miki725 added the docker label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant