Search code examples
performancedockerbuilder

move default docker container to another place on the disk


We are trying to figure out how to change the target place of the docker container. By default it is created in /var/lib/docker/containers. Lets say I would like to move it to /tmp/docker. All I could find so far was the docker volumes but it is not doing the thing the purpose of this usage is different.

What we want to do is to place the container in the RAM memory of the server so we can significantly reduce the time spent for building binaries.

Is it possible?

Regards, Jordan


Solution

  • There appears to be a -g command line option, I don't really understand why it is called graph...

    It has been deprecated and renamed to --data-root.

    --data-root /var/lib/docker              Path to use as the root of the Docker runtime
    

    https://docs.docker.com/reference/commandline/cli/

    mkdir /tmp/docker && docker --data-root /var/lib/docker /tmp/docker ...