- #MAC OS DOCKER CHANGE DEFAULT DOCKER IMAGE DIRECTORY HOW TO#
- #MAC OS DOCKER CHANGE DEFAULT DOCKER IMAGE DIRECTORY MAC OS#
- #MAC OS DOCKER CHANGE DEFAULT DOCKER IMAGE DIRECTORY SERIES#
It also means we can use a Linux distribution of Db2. This makes it fairly simple to run any Linux application, program, or server process in its own container within the desktop environment. On macOS, Docker uses a Linux-based container. Let's start with getting macOS Docker Desktop set up and get Db2 running on it. I plan to go a bit further and get this usable for development on macOS, but that seems ambitious, so I had better break it down into multiple articles.
Ian Bjorhovde wrote an excellent article for IDUG members. This is not the first article to cover Db2 on Docker, of course.
#MAC OS DOCKER CHANGE DEFAULT DOCKER IMAGE DIRECTORY HOW TO#
In this article, I'll go into how to set up and use Db2 using Docker on macOS. With the upsurge of virtualization tools, it has become much easier to work with Db2 on macOS. So, even when I could run a native Db2 server on my machine, I still ended up maintaining a Linux instance as well.
#MAC OS DOCKER CHANGE DEFAULT DOCKER IMAGE DIRECTORY MAC OS#
There was a brief period in 2009 when IBM provided a macOS implementation of Db2 Express-C v9.7 on Mac OS X, but many of the tools were not included and running a back-level version doesn't do much good over time. I have been using Apple computers as my primary platform for many years.įor most of those years, I had to maintain Linux/Windows virtual machines (using VMWare Fusion) in order to do much. The first step is installing Db2 using Docker. The plan is to get the environment set up first, then some tools, and finally programming.
#MAC OS DOCKER CHANGE DEFAULT DOCKER IMAGE DIRECTORY SERIES#
2 root root 4096 Apr 25 07:24 initĭrwx-.This is the first of a series of articles focused on setting up an Apple computer as a development environment for Db2 databases. 1 root root 19 Apr 25 07:24 repositories-devicemapper 4 root root 4096 Apr 25 07:24 devicemapperĭrwx. Now the Data file shows /mnt/doc/docker as the destination container storage location.Īlso, you will notice that there will be a repo created as soon as you restart the docker service ls -lrtĭrwx.
Step 3: Restart the docker service: docker docker info Take a look at the current docker directory: ls /mnt/doc/docker/Ģa) Make a backup – tar -zcC /var/lib docker > /mnt/doc/var_lib_docker-backup-$(date +%s).tar.gzģ) Move the /mnt/doc/docker directory to your new partition: mv /mnt/doc/docker /mnt/doc/dockerĤ) Make a symlink: ln -s /mnt/doc/docker /mnt/doc/dockerĥ) Take a peek at the directory structure to make sure it looks like it did before the mv: ls /mnt/doc/docker/ (note the trailing slash to resolve the symlink)Ħ) Start docker back up service docker start Verify no docker process is running ps fauxĢ) Double check docker really isn’t running. After a restart, (service docker restart) Docker should use the new directory.Īll I did is added a line -g /mnt/doc/docker -p /var/run/docker.pid to the OPTIONS.Ĭaution – These steps depend on your current /mnt/doc/docker being an actual directory (not a symlink to another location).ġ) Stop docker: service docker stop. If there’s more than one option, make sure you enclose them in ” “.
Now I can use /mnt/doc/docker folder to store all my containers. You can see the status of current disk space, and where I have a new disk /dev/sdb1 added and mounted under /mnt/doc/. We can fix by adding a new virtual disk (in case you are running it under VM), partioning it and mounting it under /mnt/doc. df -hįilesystem Size Used Avail Use% Mounted on You can keep check the server space using df command. Sometimes, if you are using much containers or your server space is limited, you may run out od space. Will see how to change the docker default installation directory. To avoid such a case, we can change the default installation path to preferable one or separate directory. Normally this may cost, make your server running out of space while you are creating more and more containers. By default, Docker places the containers under /mnt/doc/docker/containers which you can get from docker info command as “Docker Root Directory”.