Skip to content

Instantly share code, notes, and snippets.

@lowstz
Last active August 29, 2015 14:11
Show Gist options
  • Save lowstz/9e8a25fbd792944b4c07 to your computer and use it in GitHub Desktop.
Save lowstz/9e8a25fbd792944b4c07 to your computer and use it in GitHub Desktop.
Customizing docker on CoreOS

4 step to upadte the dev environment with docker-web

  1. Replace the user-data file on your coreos-vagrant directory.
  2. Run command: vagrant provision
  3. Run command: vagrant reload
  4. Open the docker-web site, have fun :)

btw: upgrade the coreos to latest stable version if possible. You need a vpn to complete this task, because the googleapis site was blocked in China.

3 step for this task:

  • Connect your vpn (very important!!)
  • In CoreOS Environment:
core@core-01 ~ $ sudo update_engine_client -check_for_update
core@core-01 ~ $ journalctl -fu  update-engine  # check the update status.
  • If the update is complete, CoreOS will automatically reboot
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
# WARNING: replace each time you 'vagrant destroy'
#discovery: https://discovery.etcd.io/<token>
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
fleet:
public-ip: $public_ipv4
units:
- name: docker.service
command: restart
content: |
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
Requires=docker.socket
After=docker.socket
[Service]
Environment="TMPDIR=/var/tmp/"
ExecStartPre=/bin/mount --make-rprivate /
Environment=DOCKER_OPTS='--registry-mirror=http://d242e5a2.m.daocloud.io --insecure-registry=docker.curio.im'
LimitNOFILE=1048576
LimitNPROC=1048576
# Run docker but don't have docker automatically restart
# containers. This is a job for systemd and unit files.
ExecStart=/usr/bin/docker --daemon --storage-driver=btrfs --host=fd:// --api-enable-cors=true $DOCKER_OPTS
[Install]
WantedBy=multi-user.target
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: docker-tcp.socket
command: start
enable: true
content: |
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
Service=docker.service
BindIPv6Only=both
[Install]
WantedBy=sockets.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment