{"id":1008,"date":"2016-10-15T15:47:34","date_gmt":"2016-10-15T20:47:34","guid":{"rendered":"https:\/\/www.softwareab.net\/wordpress\/?p=1008"},"modified":"2016-10-19T00:04:13","modified_gmt":"2016-10-19T05:04:13","slug":"docker-macosx-modify-hostconfig-existing-container","status":"publish","type":"post","link":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/","title":{"rendered":"Docker, Mac\/OSX, xhyve: Modify Container&#8217;s HostConfig"},"content":{"rendered":"<p>Hello Friends &#8211; Today I wanted to do some reorganization to my docker containers on my development box where I use Docker, Mac\/OSX, xhyve for development. It was really very simple &#8211; I wanted to move my containers under a local directory (same as the namespace I like to use: <code>sab<\/code>).<\/p>\n<h2>A Simple Folder Rename&#8230;<\/h2>\n<p>Here&#8217;s the old structure:<\/p>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:docker l.abruce$ <strong>pwd<\/strong>\r\n<em>\/Users\/l.abruce\/proj\/docker<\/em>\r\n\r\nCloudraticSolutionsLLCs-MacBook-Pro:docker l.abruce$ <strong>ls -la<\/strong>\r\n<em>total 16\r\ndrwxr-xr-x  6 l.abruce  staff   204 Oct 15 15:33 .\r\ndrwxr-xr-x  9 l.abruce  staff   306 Jun  3 16:33 ..\r\n-rw-r--r--@ 1 l.abruce  staff  6148 Jun  3 17:07 .DS_Store\r\ndrwxr-xr-x  3 l.abruce  staff   102 Jul 24 19:31 yum-repo<\/em><\/code><\/pre>\n<p>So a couple of commands later I have things rearranged:<\/p>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:sab l.abruce$ <strong>pwd<\/strong>\r\n<em>\/Users\/l.abruce\/proj\/docker\/sab<\/em>\r\n\r\nCloudraticSolutionsLLCs-MacBook-Pro:sab l.abruce$ <strong>ls -la<\/strong>\r\n<em>total 0\r\ndrwxr-xr-x  6 l.abruce  staff  204 Oct 15 12:02 .\r\ndrwxr-xr-x  6 l.abruce  staff  204 Oct 15 15:33 ..\r\ndrwxr-xr-x  8 l.abruce  staff  272 Oct 15 12:00 yum-repo<\/em><\/code><\/pre>\n<p>No big change&#8230;but the Docker container now has a problem. I have moved a mounted folder around on it! Let&#8217;s first see the container (and it&#8217;s GUID):<\/p>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:~ l.abruce$ <strong>docker ps -a<\/strong>\r\n<em>CONTAINER ID        IMAGE                         COMMAND             CREATED             STATUS                            PORTS               NAMES\r\ne56f5e722826        sab\/yum-repo:1                \"\/bin\/bash\"         5 months ago        Exited (137) About a minute ago                       sab-yum-repo<\/em><\/code><\/pre>\n<p>Now let&#8217;s look at the mounted folder that will give me fits because I have moved it:<\/p>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:sab l.abruce$ <strong>docker inspect sab-yum-repo<\/strong>\r\n<em>[\r\n    {\r\n        [...output cut...]\r\n        \"Mounts\": [\r\n            {\r\n                <strong>\"Source\": \"\/Users\/l.abruce\/proj\/docker\/yum-repo\/yumrepo\",<\/strong>\r\n                \"Destination\": \"\/yumrepo\",\r\n                \"Mode\": \"\",\r\n                \"RW\": true,\r\n                \"Propagation\": \"rprivate\"\r\n            }\r\n        ],\r\n        [...output cut...]\r\n    }\r\n]<\/em><\/code><\/pre>\n<h2>&#8230;Leads to Problems!<\/h2>\n<p>You see the problem? It&#8217;s the reference to the <strong>old mount location<\/strong>. Now I could simply recreate the container (I have a Dockerfile and an automated init script that gets loaded from my local Git repo), but I realized that with the <a href=\"http:\/\/www.docker.com\/products\/docker#\/mac\">Integrated Docker for Mac\/OSX<\/a> which I&#8217;m using &#8211; I couldn&#8217;t easily get to the <code>containers<\/code> location where the JSON descriptor files are stored.<\/p>\n<h2>Docker, Container Metadata, and <code>xhyve<\/code><\/h2>\n<p>Docker stores container metadata (depending on your backing filesystem) in a well-known location: <code>\/var\/lib\/docker\/containers\/[CONTAINER_ID]\/<\/code> under the files <code>config.v2.json<\/code> and \/ or <code>hostconfig.json<\/code>. Since I moved my folders around on the Docker host, I need to update these files. This is simple on Linux &#8211; see <a href=\"http:\/\/patrickz.developer-labs.com\/2016\/08\/how-to-changemodify-container-options.html\">this reference on modifying container options<\/a>. And on &#8220;classic&#8221; <a href=\"https:\/\/docs.docker.com\/machine\/get-started\/\">Docker integrated with VirtualBox<\/a> it&#8217;s still easy; you simply connect to the VirtualBox <code>docker-machine<\/code> VM (normally just called &#8220;<code>default<\/code>&#8220;) and we can get to the filesystem as we would on a native Linux installation of Docker.<\/p>\n<p>However &#8211; there is one problem. I&#8217;m using the <a href=\"https:\/\/blog.docker.com\/2016\/03\/docker-for-mac-windows-beta\/\">New Docker \/ xhyve Integration<\/a> which eliminates the need for VirtualBox, <code>docker-machine<\/code>, or any of that cruft. But the question I had &#8211; how do I get to the lightweight <a href=\"https:\/\/wiki.alpinelinux.org\/\">Alpine Linux<\/a> which Docker runs as an <a href=\"https:\/\/github.com\/mist64\/xhyve\"><code>xhyve<\/code><\/a> process?<\/p>\n<h2><code>ps<\/code> and <code>screen<\/code> to the Rescue<\/h2>\n<p>The first thing I did was to learn how this <code>xhyve<\/code> integration works. I was half-expecting to find some CLI tools similar to <code>virsh<\/code> or <code>esxcli<\/code> but <code>xhyve<\/code> seems to work differently. Take a look at <code>ps<\/code> output:<\/p>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:~ l.abruce$ <strong>ps -efa | grep -i -e docker | grep -v grep<\/strong>\r\n<em>    0    99     1   0 Sun07AM ??         0:00.02 \/Library\/PrivilegedHelperTools\/com.docker.vmnetd\r\n  502 26682     1   0  4:08PM ??         0:00.26 \/Applications\/Docker.app\/Contents\/MacOS\/Docker\r\n  502 26694 26682   0  4:08PM ??         0:00.03 \/Applications\/Docker.app\/Contents\/MacOS\/com.docker.osx.hyperkit.linux -watchdog fd:0\r\n  502 26696 26694   0  4:08PM ??         0:00.01 \/Applications\/Docker.app\/Contents\/MacOS\/com.docker.osx.hyperkit.linux -watchdog fd:0\r\n  502 26697 26694   0  4:08PM ??         0:00.25 com.docker.db --url fd:3 --git \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/database\r\n  502 26698 26694   0  4:08PM ??         0:00.11 com.docker.osxfs --address fd:3 --connect \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/@connect --control fd:4 --volume-control fd:5 --database \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s40\r\n  502 26699 26694   0  4:08PM ??         0:00.03 com.docker.slirp --db \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s40 --ethernet fd:3 --port fd:4 --vsock-path \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/@connect --max-connections 900\r\n  502 26700 26694   0  4:08PM ??         0:00.02 com.docker.osx.hyperkit.linux\r\n  502 26701 26694   0  4:08PM ??         0:00.07 com.docker.driver.amd64-linux -db \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s40 -osxfs-volume \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s30 -slirp \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s50 -vmnet \/var\/tmp\/com.docker.vmnetd.socket -port \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s51 -vsock \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data -docker \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s60 -addr fd:3 -debug\r\n  502 26702 26700   0  4:08PM ??         0:00.01 \/Applications\/Docker.app\/Contents\/MacOS\/com.docker.osx.hyperkit.linux\r\n  502 26703 26701   0  4:08PM ??         0:00.02 \/Applications\/Docker.app\/Contents\/MacOS\/com.docker.driver.amd64-linux -db \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s40 -osxfs-volume \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s30 -slirp \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s50 -vmnet \/var\/tmp\/com.docker.vmnetd.socket -port \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s51 -vsock \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data -docker \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s60 -addr fd:3 -debug\r\n  502 26705 26701   0  4:08PM ??         0:05.47 \/Applications\/Docker.app\/Contents\/MacOS\/com.docker.hyperkit -A -m 2G -c 4 -u -s 0:0,hostbridge -s 31,lpc -s 2:0,virtio-vpnkit,uuid=525496a2-c58d-4df2-93e5-2584885d63f5,path=\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s50,macfile=\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux\/mac.0 -s 3,virtio-blk,file:\/\/\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux\/Docker.qcow2,format=qcow -s 4,virtio-9p,path=\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s40,tag=db -s 5,virtio-rnd -s 6,virtio-9p,path=\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/s51,tag=port -s 7,virtio-sock,guest_cid=3,path=\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data,guest_forwards=2376;1525 -l com1,autopty=\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux\/tty,log=\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux\/console-ring -f kexec,\/Applications\/Docker.app\/Contents\/Resources\/moby\/vmlinuz64,\/Applications\/Docker.app\/Contents\/Resources\/moby\/initrd.img,earlyprintk=serial console=ttyS0 com.docker.driver=\"com.docker.driver.amd64-linux\", com.docker.database=\"com.docker.driver.amd64-linux\" ntp=gateway mobyplatform=mac -F \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux\/hypervisor.pid\r\n  502 26711 26682   0  4:08PM ??         0:00.01 \/Applications\/Docker.app\/Contents\/MacOS\/com.docker.frontend {\"action\":\"vmstateevent\",\"args\":{\"vmstate\":\"running\"}}\r\n  502 26712 26711   0  4:08PM ??         0:00.01 \/Applications\/Docker.app\/Contents\/MacOS\/com.docker.frontend {\"action\":\"vmstateevent\",\"args\":{\"vmstate\":\"running\"}}<\/em><\/code><\/pre>\n<p>There&#8217;s a great resource on <a href=\"http:\/\/pnasrat.github.io\/2016\/04\/27\/insider-docker-for-os-x-i\">Inside Docker \/ <code>xhyve<\/code> Integration<\/a> which you can read up on, but to me the key points are the references to <code>hyperkit<\/code> (promising!) and the references to the folder <code>\/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux<\/code> &#8211; there are <strong>five<\/strong> of those references.<\/p>\n<p>So now we take a look at that folder:<\/p>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:sab l.abruce$ <strong>ls -la \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux<\/strong>\r\n<em>total 37451664\r\ndrwxr-xr-x@ 12 l.abruce  staff          408 Oct 15 16:08 .\r\ndrwxr-xr-x  20 l.abruce  staff          680 Oct 15 16:08 ..\r\n-rw-r--r--   1 l.abruce  staff  19174981632 Oct 15 16:15 Docker.qcow2\r\n-rw-r--r--   1 l.abruce  staff        65536 Oct 15 16:08 console-ring\r\n-rw-r--r--   1 l.abruce  staff            5 Oct 15 16:08 hypervisor.pid\r\n-rw-r--r--   1 l.abruce  staff            0 Jul 24 19:09 lock\r\ndrwxr-xr-x   5 l.abruce  staff          170 Aug 11 01:51 log\r\n-rw-r--r--   1 l.abruce  staff           17 Oct 15 16:08 mac.0\r\n-rw-r--r--   1 l.abruce  staff           36 Jul 24 19:09 nic1.uuid\r\n-rw-r--r--   1 l.abruce  staff            5 Oct 15 16:08 pid\r\n-rw-r--r--   1 l.abruce  staff       182996 Oct 15 16:08 syslog\r\n<strong>lrwxr-xr-x   1 l.abruce  staff           12 Oct 15 16:08 tty -> \/dev\/ttys000<\/strong><\/em><\/code><\/pre>\n<p>Folks, look at that reference to <code>tty<\/code>. Looks to me like it&#8217;s a console interface to *something* &#8211; and that something looks awfully close to being a VM managed by a hypervisor. So let&#8217;s go into <code>screen<\/code>:<\/p>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:sab l.abruce$ <strong>screen \/Users\/l.abruce\/Library\/Containers\/com.docker.docker\/Data\/com.docker.driver.amd64-linux\/tty<\/strong>\r\n<em>\r\nWelcome to Moby\r\nKernel 4.4.20-moby on an x86_64 (\/dev\/ttyS0)\r\n\r\n                        ##         .\r\n                  ## ## ##        ==\r\n               ## ## ## ## ##    ===\r\n           \/\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"___\/ ===\r\n      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ \/  ===- ~~~\r\n           \\______ o           __\/\r\n             \\    \\         __\/\r\n              \\____\\_______\/\r\n\r\nmoby login: root\r\nWelcome to Moby, based on Alpine Linux.\r\nmoby:~# <\/em><\/code><\/pre>\n<p><strong>Full Disclosure: <\/strong> To get the fact that there is <em>no root password<\/em> I had to search around a bit and found the answer from our StackOverflow friends at <a href=\"https:\/\/stackoverflow.com\/questions\/39455764\/change-storage-driver-for-docker-on-os-x\">https:\/\/stackoverflow.com\/questions\/39455764\/change-storage-driver-for-docker-on-os-x<\/a>.<\/p>\n<p>But now I am actually on the Alpine Linux VM that Docker uses to manage containers, and presumably I can find my container&#8217;s metadata in the usual location. Let&#8217;s go look!<\/p>\n<pre><code>moby:~# <strong>cd \/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161<\/strong>\r\n\r\nmoby:\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161# <strong>ls -la<\/strong>\r\n<em>total 44\r\ndrwx------    3 root     root          4096 Oct 15 20:08 .\r\ndrwx------    7 root     root          4096 Oct 15 16:13 ..\r\n-rw-------    1 root     root          2674 Oct  4 08:34 .tmp-config.v2.json523583531\r\n-rw-rw-rw-    1 root     root          2677 Oct 15 20:07 config.v2.json\r\n-rw-r-----    1 root     root          3011 Oct 15 20:07 e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161-json.log\r\n-rw-rw-rw-    1 root     root          1159 Oct 15 20:08 hostconfig.json\r\n-rw-r--r--    1 root     root            13 Oct 15 19:38 hostname\r\n-rw-r--r--    1 root     root           174 Oct 15 19:38 hosts\r\n-rw-r--r--    1 root     root           230 Oct 15 19:38 resolv.conf\r\n-rw-r--r--    1 root     root            71 Oct 15 19:38 resolv.conf.hash\r\ndrwx------    2 root     root          4096 Apr 25 02:10 shm<\/em><\/code><\/pre>\n<p>Profit! We have located the two config files. In my case, I know I have mounted the <code>yumrepo<\/code> folder to my original user directory, and the reference is indeed in the files:<\/p>\n<pre><code>moby:\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161# <strong>grep -l -e yumrepo *.json<\/strong>\r\n<em>config.v2.json\r\nhostconfig.json<\/em><\/code><\/pre>\n<p>Let&#8217;s now <a href=\"https:\/\/wiki.alpinelinux.org\/wiki\/Alpine_Linux_Init_System\"><\/a>stop and restart the Docker service<\/a>:<\/p>\n<pre><code>moby:\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161# <strong>rc-status<\/strong>\r\n<em>Runlevel: default\r\n [...output cut...]\r\n docker\r\n [  started  ]<\/em>\r\n\r\nmoby:\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161# <strong>rc-service docker stop<\/strong>\r\n * Stopping docker\r\n<\/em><\/code><\/pre>\n<p>Now we simply edit the two JSON files using good ol&#8217; <code>vi<\/code> and update the directory mount point:<\/p>\n<pre><code>moby:\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161# <strong>grep -e yumrepo *.json<\/strong>\r\n<em>config.v2.json:{\"State\":{\"Running\":false,\"Paused\":false,\"Restarting\":false,\"OOMKilled\":false,\"RemovalInProgress\":false,\"Dead\":false,\"Pid\":0,\"StartedAt\":\"2016-10-15T19:38:16.482788677Z\",\"FinishedAt\":\"2016-10-15T20:07:04.961379487Z\",\"Health\":null},\"ID\":\"e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161\",\"Created\":\"2016-04-25T02:10:23.698922171Z\",\"Managed\":false,\"Path\":\"\/bin\/bash\",\"Args\":[],\"Config\":{\"Hostname\":\"e56f5e722826\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"ExposedPorts\":{\"80\/tcp\":{}},\"Tty\":true,\"OpenStdin\":true,\"StdinOnce\":false,\"Env\":[\"PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin\"],\"Cmd\":[\"\/bin\/bash\"],\"Image\":\"sab\/yum-repo:1\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":{\"build-date\":\"2016-03-31\",\"license\":\"GPLv2\",\"name\":\"CentOS Base Image\",\"vendor\":\"CentOS\"},\"StopSignal\":\"SIGTERM\"},\"Image\":\"sha256:7ca8dd769605d08a61d88b11ab2e0f1b9355596b7519aaaf2ac8a97915dec6d4\",\"NetworkSettings\":{\"Bridge\":\"\",\"SandboxID\":\"06f060a6be3a37c5900b82570eeb3f0fd3db4235dbf91a0cb7dfa0dd0ecb3238\",\"HairpinMode\":false,\"LinkLocalIPv6Address\":\"\",\"LinkLocalIPv6PrefixLen\":0,\"Networks\":{\"bridge\":{\"IPAMConfig\":null,\"Links\":null,\"Aliases\":null,\"NetworkID\":\"6c607797fe25f490c70b6f54bd2a0a2e306ad7340d40e4e45c226017409c6bff\",\"EndpointID\":\"\",\"Gateway\":\"\",\"IPAddress\":\"\",\"IPPrefixLen\":0,\"IPv6Gateway\":\"\",\"GlobalIPv6Address\":\"\",\"GlobalIPv6PrefixLen\":0,\"MacAddress\":\"\"}},\"Service\":null,\"Ports\":null,\"SandboxKey\":\"\/var\/run\/docker\/netns\/06f060a6be3a\",\"SecondaryIPAddresses\":null,\"SecondaryIPv6Addresses\":null,\"IsAnonymousEndpoint\":false},\"LogPath\":\"\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161-json.log\",\"Name\":\"\/sab-yum-repo\",\"Driver\":\"aufs\",\"MountLabel\":\"\",\"ProcessLabel\":\"\",\"RestartCount\":0,\"HasBeenStartedBefore\":true,\"HasBeenManuallyStopped\":true,<strong>\"MountPoints\":{\"\/yumrepo\":{\"Source\":\"\/Users\/l.abruce\/proj\/docker\/sab\/yum-repo\/yumrepo\",\"Destination\":\"\/yumrepo\",\"RW\":true,\"Name\":\"\",\"Driver\":\"\",\"Relabel\":\"\",\"Propagation\":\"rprivate\",\"Named\":false,\"ID\":\"\"}<\/strong>},\"AppArmorProfile\":\"\",\"HostnamePath\":\"\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161\/hostname\",\"HostsPath\":\"\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161\/hosts\",\"ShmPath\":\"\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161\/shm\",\"ResolvConfPath\":\"\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161\/resolv.conf\",\"SeccompProfile\":\"\",\"NoNewPrivileges\":false}\r\n\r\nhostconfig.json:{<strong>\"Binds\":[\"\/Users\/l.abruce\/proj\/docker\/sab\/yum-repo\/yumrepo:\/yumrepo\"]<\/strong>,\"ContainerIDFile\":\"\",\"LogConfig\":{\"Type\":\"json-file\",\"Config\":{}},\"NetworkMode\":\"default\",\"PortBindings\":{\"80\/tcp\":[{\"HostIp\":\"\",\"HostPort\":\"15080\"}]},\"RestartPolicy\":{\"Name\":\"no\",\"MaximumRetryCount\":0},\"AutoRemove\":false,\"VolumeDriver\":\"\",\"VolumesFrom\":null,\"CapAdd\":null,\"CapDrop\":null,\"Dns\":[],\"DnsOptions\":[],\"DnsSearch\":[],\"ExtraHosts\":null,\"GroupAdd\":null,\"IpcMode\":\"\",\"Cgroup\":\"\",\"Links\":[],\"OomScoreAdj\":0,\"PidMode\":\"\",\"Privileged\":false,\"PublishAllPorts\":false,\"ReadonlyRootfs\":false,\"SecurityOpt\":null,\"UTSMode\":\"\",\"UsernsMode\":\"\",\"ShmSize\":67108864,\"Runtime\":\"runc\",\"ConsoleSize\":[0,0],\"Isolation\":\"\",\"CpuShares\":0,\"Memory\":0,\"CgroupParent\":\"\",\"BlkioWeight\":0,\"BlkioWeightDevice\":null,\"BlkioDeviceReadBps\":null,\"BlkioDeviceWriteBps\":null,\"BlkioDeviceReadIOps\":null,\"BlkioDeviceWriteIOps\":null,\"CpuPeriod\":0,\"CpuQuota\":0,\"CpusetCpus\":\"\",\"CpusetMems\":\"\",\"Devices\":[],\"DiskQuota\":0,\"KernelMemory\":0,\"MemoryReservation\":0,\"MemorySwap\":0,\"MemorySwappiness\":-1,\"OomKillDisable\":false,\"PidsLimit\":0,\"Ulimits\":null,\"CpuCount\":0,\"CpuPercent\":0,\"IOMaximumIOps\":0,\"IOMaximumBandwidth\":0}<\/em><\/code><\/pre>\n<p>Maybe hard to read, but I hope you can see where I updated the mount \/ bind points.<\/p>\n<p>Finally, restart the service:<\/p>\n<pre><code>moby:\/var\/lib\/docker\/containers\/e56f5e7228263150ecd5e698d73a68481272b4551e6ea707b9ce30676e31c161# <strong>rc-service docker start<\/strong>\r\n<em> * Starting Docker ...\r\n [ ok ]<\/em><\/code><\/pre>\n<h2>The Final Frontier: Restart the Container<\/h2>\n<p>After all this work, we restart our container and check the binding:<\/p>\n<pre><code>docker start sab-yum-repo<\/code><\/pre>\n<pre><code>CloudraticSolutionsLLCs-MacBook-Pro:~ l.abruce$ <strong>docker inspect sab-yum-repo<\/strong>\r\n<em>[\r\n    {\r\n        [...output cut...]\r\n        \"Mounts\": [\r\n            {\r\n                \"Source\": \"\/Users\/l.abruce\/proj\/docker\/sab\/yum-repo\/yumrepo\",\r\n                \"Destination\": \"\/yumrepo\",\r\n                \"Mode\": \"\",\r\n                \"RW\": true,\r\n                \"Propagation\": \"rprivate\"\r\n            }\r\n        ],\r\n        [...output cut...]\r\n    }\r\n]<\/em><\/code><\/pre>\n<p>Success. And we learned a lot about how Docker, <code>xhyve<\/code>, and Alpine Linux are playing together.<\/p>\n<p>Happy Computing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Friends &#8211; Today I wanted to do some reorganization to my docker containers on my development box where I use Docker, Mac\/OSX, xhyve for development. It was really very simple &#8211; I wanted to move my containers under a &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\"> <span class=\"screen-reader-text\">Docker, Mac\/OSX, xhyve: Modify Container&#8217;s HostConfig<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91,1],"tags":[87,74,71],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker, Mac\/OSX, xhyve: Modify Container&#039;s HostConfig - softwareab<\/title>\n<meta name=\"description\" content=\"Docker, Mac\/OSX, xhyve: Need to modify Docker Container HostConfig data on Mac\/OSX? Read our article to find out how (and a quick intro to Alpine Linux).\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker, Mac\/OSX, xhyve: Modify Container&#039;s HostConfig - softwareab\" \/>\n<meta property=\"og:description\" content=\"Docker, Mac\/OSX, xhyve: Need to modify Docker Container HostConfig data on Mac\/OSX? Read our article to find out how (and a quick intro to Alpine Linux).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\" \/>\n<meta property=\"og:site_name\" content=\"softwareab\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cloudraticsolutions\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/cloudraticsolutions\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-15T20:47:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-10-19T05:04:13+00:00\" \/>\n<meta name=\"author\" content=\"Andrew Bruce\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@realcloudratics\" \/>\n<meta name=\"twitter:site\" content=\"@realcloudratics\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Bruce\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\"},\"author\":{\"name\":\"Andrew Bruce\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"headline\":\"Docker, Mac\/OSX, xhyve: Modify Container&#8217;s HostConfig\",\"datePublished\":\"2016-10-15T20:47:34+00:00\",\"dateModified\":\"2016-10-19T05:04:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\"},\"wordCount\":617,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"keywords\":[\"docker\",\"OSX\",\"virtualization\"],\"articleSection\":[\"Docker\",\"Teknocratica\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\",\"name\":\"Docker, Mac\/OSX, xhyve: Modify Container's HostConfig - softwareab\",\"isPartOf\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#website\"},\"datePublished\":\"2016-10-15T20:47:34+00:00\",\"dateModified\":\"2016-10-19T05:04:13+00:00\",\"description\":\"Docker, Mac\/OSX, xhyve: Need to modify Docker Container HostConfig data on Mac\/OSX? Read our article to find out how (and a quick intro to Alpine Linux).\",\"breadcrumb\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.softwareab.net\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"docker\",\"item\":\"https:\/\/www.softwareab.net\/wordpress\/tag\/docker\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Docker, Mac\/OSX, xhyve: Modify Container&#8217;s HostConfig\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#website\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/\",\"name\":\"softwareab\",\"description\":\"Technocratica, Technopolitik, Technophobia\",\"publisher\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.softwareab.net\/wordpress\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600\",\"name\":\"Andrew Bruce\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg\",\"contentUrl\":\"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg\",\"width\":400,\"height\":330,\"caption\":\"Andrew Bruce\"},\"logo\":{\"@id\":\"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/\"},\"description\":\"Team-oriented systems mentor with deep knowledge of numerous software methodologies, technologies, languages, and operating systems. Excited about turning emerging technology into working production-ready systems. Focused on moving software teams to a higher level of world-class application development. Specialties:Software analysis and development...Product management through the entire lifecycle...Discrete product integration specialist!\",\"sameAs\":[\"http:\/\/cloudraticsolutions.net\/\",\"https:\/\/www.facebook.com\/cloudraticsolutions\/\",\"https:\/\/twitter.com\/realcloudratics\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Docker, Mac\/OSX, xhyve: Modify Container's HostConfig - softwareab","description":"Docker, Mac\/OSX, xhyve: Need to modify Docker Container HostConfig data on Mac\/OSX? Read our article to find out how (and a quick intro to Alpine Linux).","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/","og_locale":"en_US","og_type":"article","og_title":"Docker, Mac\/OSX, xhyve: Modify Container's HostConfig - softwareab","og_description":"Docker, Mac\/OSX, xhyve: Need to modify Docker Container HostConfig data on Mac\/OSX? Read our article to find out how (and a quick intro to Alpine Linux).","og_url":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/","og_site_name":"softwareab","article_publisher":"https:\/\/www.facebook.com\/cloudraticsolutions\/","article_author":"https:\/\/www.facebook.com\/cloudraticsolutions\/","article_published_time":"2016-10-15T20:47:34+00:00","article_modified_time":"2016-10-19T05:04:13+00:00","author":"Andrew Bruce","twitter_card":"summary_large_image","twitter_creator":"@realcloudratics","twitter_site":"@realcloudratics","twitter_misc":{"Written by":"Andrew Bruce","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#article","isPartOf":{"@id":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/"},"author":{"name":"Andrew Bruce","@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"headline":"Docker, Mac\/OSX, xhyve: Modify Container&#8217;s HostConfig","datePublished":"2016-10-15T20:47:34+00:00","dateModified":"2016-10-19T05:04:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/"},"wordCount":617,"commentCount":0,"publisher":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"keywords":["docker","OSX","virtualization"],"articleSection":["Docker","Teknocratica"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/","url":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/","name":"Docker, Mac\/OSX, xhyve: Modify Container's HostConfig - softwareab","isPartOf":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#website"},"datePublished":"2016-10-15T20:47:34+00:00","dateModified":"2016-10-19T05:04:13+00:00","description":"Docker, Mac\/OSX, xhyve: Need to modify Docker Container HostConfig data on Mac\/OSX? Read our article to find out how (and a quick intro to Alpine Linux).","breadcrumb":{"@id":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.softwareab.net\/wordpress\/docker-macosx-modify-hostconfig-existing-container\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.softwareab.net\/wordpress\/"},{"@type":"ListItem","position":2,"name":"docker","item":"https:\/\/www.softwareab.net\/wordpress\/tag\/docker\/"},{"@type":"ListItem","position":3,"name":"Docker, Mac\/OSX, xhyve: Modify Container&#8217;s HostConfig"}]},{"@type":"WebSite","@id":"https:\/\/www.softwareab.net\/wordpress\/#website","url":"https:\/\/www.softwareab.net\/wordpress\/","name":"softwareab","description":"Technocratica, Technopolitik, Technophobia","publisher":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.softwareab.net\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/1337443eaeb75104e0410b508e67f600","name":"Andrew Bruce","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg","contentUrl":"https:\/\/www.softwareab.net\/wordpress\/wp-content\/uploads\/2024\/03\/andy-cartoon.jpg","width":400,"height":330,"caption":"Andrew Bruce"},"logo":{"@id":"https:\/\/www.softwareab.net\/wordpress\/#\/schema\/person\/image\/"},"description":"Team-oriented systems mentor with deep knowledge of numerous software methodologies, technologies, languages, and operating systems. Excited about turning emerging technology into working production-ready systems. Focused on moving software teams to a higher level of world-class application development. Specialties:Software analysis and development...Product management through the entire lifecycle...Discrete product integration specialist!","sameAs":["http:\/\/cloudraticsolutions.net\/","https:\/\/www.facebook.com\/cloudraticsolutions\/","https:\/\/twitter.com\/realcloudratics"]}]}},"_links":{"self":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/1008"}],"collection":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/comments?post=1008"}],"version-history":[{"count":5,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/1008\/revisions"}],"predecessor-version":[{"id":1022,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/posts\/1008\/revisions\/1022"}],"wp:attachment":[{"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/media?parent=1008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/categories?post=1008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwareab.net\/wordpress\/wp-json\/wp\/v2\/tags?post=1008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}