Merge pull request #2529 from justincormack/swap-mac

Add swap to the Docker for Mac blueprint
This commit is contained in:
Justin Cormack 2017-09-22 09:03:06 -07:00 committed by GitHub
commit 404b1e1cb1
3 changed files with 8 additions and 4 deletions

View File

@ -30,10 +30,10 @@ To build it with the latest Docker CE:
$ moby build -name docker-for-mac base.yml docker-ce.yml
```
To run the VM with a 500M disk:
To run the VM with a 4G disk:
```
linuxkit run hyperkit -networking=vpnkit -vsock-ports=2376 -disk size=500M -data ./metadata.json docker-for-mac
linuxkit run hyperkit -networking=vpnkit -vsock-ports=2376 -disk size=4096M -data ./metadata.json docker-for-mac
```
In another terminal you should now be able to access docker via the socket `guest.00000947` in the state directory (`docker-for-mac-state/` by default):

View File

@ -24,6 +24,10 @@ onboot:
- name: mount
image: linuxkit/mount:4fe245efb01384e42622c36302e13e386bbaeb08
command: ["/usr/bin/mountie", "/var/lib"]
# make a swap file on the mounted disk
- name: swap
image: linuxkit/swap:3881b1e0fadb7765d2fa85d03563c887ab9335a6
command: ["/swap.sh", "--path", "/var/lib/swap", "--size", "1024M"]
# mount-vpnkit mounts the 9p share used by vpnkit to coordinate port forwarding
- name: mount-vpnkit
image: alpine:3.6

View File

@ -9,10 +9,10 @@ Normally, unless you are running explicitly in a desktop version, LinuxKit image
onboot:
- name: swap
image: linuxkit/swap:<hash>
command: ["swap.sh","--path","/var/external/swap","--size","2G"]
command: ["/swap.sh","--path","/var/external/swap","--size","2G"]
```
Note that you **nust** mount the following:
Note that you **must** mount the following:
* `/var` to `/var` so it can place the swapfile in the right location.
* `/dev` to `/dev` so it can do the right thing for devices