Skip to content

Instantly share code, notes, and snippets.

@ilja
Created January 12, 2016 20:23
Show Gist options
  • Select an option

  • Save ilja/cb389cf41a910349bc21 to your computer and use it in GitHub Desktop.

Select an option

Save ilja/cb389cf41a910349bc21 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

$ ifconfig ens3

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

My mac has docker 1.9.1 and docker 1.9.1 is in the CoreOS beta channel, so lets upgrade to that.

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

$ sudo coreos-install -d /dev/sda -V current -C beta -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
@mvlwn
Copy link
Copy Markdown

mvlwn commented Jan 18, 2016

Works great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment