how to ignore logs with docker commit how to ignore logs with docker commit docker docker

how to ignore logs with docker commit


docker commit will always capture EVERYTHING in the container filesystem. It's just the way it works.

.dockerignore only applies to the docker build command. docker build uses a Dockerfile to take an existing image (like ubuntu:latest), run some modification on it, and commit the result.

If you want to build a container for use somewhere else, a Dockerfile is the way to approach it. You didn't provide much info, so here is a SUPER sparse example...

# DockerfileFROM ubuntu:latestADD myartifact /srcCMD /src/my_script.sh

and then...

docker build -t myOrg/myImage .

After which you can run the image with

docker run myOrg/myImage