ruby dev machine config example for mac / docker-machine / coreos

Supondo que:
a) você exportou / usuários via / etc / exports e ativou o nfsd
b) você tem o VirtualBox como um executor vm

Então, você precisa de um yaml de unidade de configuração como o seguinte para configurar sua dev vm

#cloud-config
---
hostname
: dev

ssh_authorized_keys
:
- ssh-rsa <some key>

write_files
:
- path: "/etc/docker/certs.d/registry.ag.local:5000/ca.crt"
permissions
: "0644"
owner
: "root"
content
: |
-----BEGIN CERTIFICATE-----
CA cert
of a local registry goes here
-----END CERTIFICATE-----

coreos
:
update
:
group: stable
reboot
-strategy: best-effort
units
:
- name: update-engine.service
command
: start
enable
: true

- name: docker.service
command
: start
enable
: true
drop
-ins:
- name: 10-wait-docker.conf
content
: |
[Unit]
After=Users.mount
Requires=Users.mount

- name: swapon.service
command
: start
content
: |
[Unit]
Description=Turn on swap
[Service]
Type=oneshot
Environment="SWAPFILE=/4GiB.swap"
RemainAfterExit=true
ExecStartPre=/usr/bin/touch ${SWAPFILE}
ExecStartPre=/usr/bin/chattr +C ${SWAPFILE}
ExecStartPre=/usr/bin/fallocate -l 4096m ${SWAPFILE}
ExecStartPre=/usr/bin/chmod 600 ${SWAPFILE}
ExecStartPre=/usr/sbin/mkswap ${SWAPFILE}
ExecStartPre=/usr/sbin/losetup -f ${SWAPFILE}
ExecStart=/usr/bin/sh -c "/sbin/swapon $(/usr/sbin/losetup -j ${SWAPFILE} | /usr/bin/cut -d : -f 1)"
ExecStop=/usr/bin/sh -c "/sbin/swapoff $(/usr/sbin/losetup -j ${SWAPFILE} | /usr/bin/cut -d : -f 1)"
ExecStopPost=/usr/bin/sh -c "/usr/sbin/losetup -d $(/usr/sbin/losetup -j ${SWAPFILE} | /usr/bin/cut -d : -f 1)"
[Install]
WantedBy=multi-user.target

- name: Users.mount
command
: start
content
: |
[Unit]
After=syslog.target network.target
Before=docker.service
[Mount]
What=192.168.99.1:/Users
Where=/Users
Type=nfs
Options=async,noacl,fsc
TimeoutSec=300
[Install]
RequiredBy=docker.service
WantedBy=docker.service

Luzes:

  • Ele lida com o registro docker local com o certificado CA correspondente
  • Ele lida com a montagem NFS de uma árvore de diretório host contendo a fonte
  • Ele cria um arquivo de troca para o caso de …