Line 84: |
Line 84: |
| /var/lib/docker | | /var/lib/docker |
| For SME Server this is not ideal for we would like to incorporate all Docker data into the pre-defined backup procedure(s) that come with SME Server. The preferred location for Docker data would be: | | For SME Server this is not ideal for we would like to incorporate all Docker data into the pre-defined backup procedure(s) that come with SME Server. The preferred location for Docker data would be: |
− | /home/e-smith/files/docker | + | '''/home/e-smith/files/docker''' |
| We want this to be the default location for all Docker data on SME Server, so we add the '-g' argument and the desired path to the storage location to the docker configuration file like this: | | We want this to be the default location for all Docker data on SME Server, so we add the '-g' argument and the desired path to the storage location to the docker configuration file like this: |
| + | |
| # /etc/sysconfig/docker | | # /etc/sysconfig/docker |
| # | | # |
Line 93: |
Line 94: |
| | | |
| other_args="-g /home/e-smith/files/docker -H unix:///var/run/docker.sock" | | other_args="-g /home/e-smith/files/docker -H unix:///var/run/docker.sock" |
| + | |
| + | |
| Since the Docker service will always check this configuration file upon (re)start, it will automatically pick up the arguments you have provided and act accordingly. That also implies that you can have multiple (but ''not'' simultaneously) storage locations if you omit the configuration file and add arguments manually on the command line. | | Since the Docker service will always check this configuration file upon (re)start, it will automatically pick up the arguments you have provided and act accordingly. That also implies that you can have multiple (but ''not'' simultaneously) storage locations if you omit the configuration file and add arguments manually on the command line. |
− |
| |
| | | |
| The second argument '-H unix:///var/run/docker.sock' will tell Docker where to find it's socket to bind. | | The second argument '-H unix:///var/run/docker.sock' will tell Docker where to find it's socket to bind. |
| | | |
| | | |
| + | It is ''important'' that you adjust the config file ''before'' you start using docker otherwise it will create it's default storage location in /var/lib/docker. |
| | | |
− | It is ''important'' that you make this change 'before' you start using docker otherwise it will create it's default storage location in /var/lib/docker.
| + | You can still change the storage location in a later stage by copying all data to the new location you've defined with the -g argument. |
| | | |
− | Once the above change has been made, the Docker service needs to be restarted and Docker will create it's new storage layout in /home/e-smith/files/docker.
| |
− | service docker restart
| |
| | | |
− | You can still change the storage location in a later stage by copying all data to the new location you've defined with the -g argument.
| + | Once the above changes have been made, the Docker service can be started and Docker will create it's new storage layout in /home/e-smith/files/docker. |
| + | service docker start |
| | | |
− | Since we already started the Docker service once (see above installation), Docker will have created it's default storage location in /var/lib/docker. However, Docker will re-create a new storage wherever you point the -g argument to, so after we have added /home/e-smith/files/docker to the Docker configuration file and restarted the Docker service, we can safely remove /var/lib/docker. This also explains why it might take a while for the Docker service to (re)start while it creates a new storage location.
| + | You can check if the docker deamon is running: |
| + | service docker status |
| + | and if it created the storage layout correctly: |
| + | ls -l /home/e-smith/files/docker/ |
| | | |
| ==Using a Docker image== | | ==Using a Docker image== |