Skip to content

Instantly share code, notes, and snippets.

@dvbportal
Forked from ilja/coreos-docker-veertu.md
Last active June 11, 2016 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvbportal/a35f7082b5fb9c9ca7afe87ae8131b97 to your computer and use it in GitHub Desktop.
Save dvbportal/a35f7082b5fb9c9ca7afe87ae8131b97 to your computer and use it in GitHub Desktop.
How to connect Docker to CoreOS in Veertu

How to connect Docker to CoreOS in Veertu

Mostly copied from http://qiita.com/A-I/items/f6f4b1b50fed9db739df

Install Veertu and download and start the CoreOS image.

Set a password for user core

$ sudo passwd core

Get the ip address

The IP address is shown in the GUI

Ssh into CoreOS

$ ssh core@192.168.64.8 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

Upgrade CoreOS

Create a cloud-config.yml file to upgrade CoreOS, add your ssh key and open the docker socket when CoreOS starts:

#cloud-config

ssh_authorized_keys:
  - ssh-rsa AAAAB6NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== my@public.key

coreos:
  units:
    - name: docker-tcp.socket
      command: start
      runtime: no
      content: |
        [Unit]
        Description=Docker Socket for the API
        [Socket]
        ListenStream=2375
        Service=docker.service
        BindIPv6Only=both
        [Install]
        WantedBy=sockets.target

    - name: docker.service
      command: start

Install the current stable CoreOS to /dev/sda with our cloud config:

The modified installer (attached) uses a local image. This allows multiple install without downloading every time. Get the image with the following command:

$ curl -O http://stable.release.core-os.net/amd64-usr/current/coreos_production_image.bin.bz2
$ curl -O http://stable.release.core-os.net/amd64-usr/current/coreos_production_image.bin.bz2.sig
$ curl -O https://raw.githubusercontent.com/coreos/init/master/bin/coreos-install

Then use the modified installer

$ sudo ./coreos-install -d /dev/sda -V current -C stable -c cloud-config.yml
$ sudo reboot

Set the docker host

$ export DOCKER_HOST=tcp://192.168.64.8:2375

Check if it works

$ docker info
363c363
<
---
> BASE_URL=.
370c370
< exit 1
---
> # exit 1
375c375
< exit 1
---
> # exit 1
388c388,389
< wget --no-verbose -O "${WORKDIR}/${SIG_NAME}" "${SIG_URL}"
---
> #wget --no-verbose -O "${WORKDIR}/${SIG_NAME}" "${SIG_URL}"
> cp -p "${SIG_URL}" "${WORKDIR}/${SIG_NAME}"
392c393
< if ! wget --no-verbose -O - "${IMAGE_URL}" \
---
> if ! cat "${IMAGE_URL}" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment