Created
November 30, 2015 19:39
-
-
Save sourcec0de/5cf7d36a5f696c2ffc68 to your computer and use it in GitHub Desktop.
Install docker compose on coreos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - | |
mkdir -p /opt/bin | |
curl -L https://github.com/docker/compose/releases/download/1.5.1/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |
version 1.19.0
sudo su -
mkdir -p /opt/bin
curl -L "https://github.com/docker/compose/releases/download/1.19.0/docker-compose-$(uname -s)-$(uname -m)" -o /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
no real point in this... just for fun.
Use a container linux file instead of a bash script
files:
- path: /opt/bin/docker-compose
filesystem: root
mode: 0744
contents:
remote:
url: https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64
verification:
hash:
function: sha512
sum: 5A9CCBE01CBF585732907F38FBACC21AECD2EDC9351BD1EE91DF750740A7FFF9D73BD489D708087D9D8892AD8F448A78A8EE401D240A51D0202ED0C08E30BF88
I made a tiny script based on this, for installing the latest
release
#!/bin/bash
LATEST_URL=`curl -Ls -o /dev/null -w %{url_effective} https://github.com/docker/compose/releases/latest`
COMPOSE_VERSION=${LATEST_URL##*/}
DOWNLOAD_URL=https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m`
curl -L ${DOWNLOAD_URL} -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Just getting the redirect link from https://github.com/docker/compose/releases/latest and checking the tag name, which maps directly to the release version.
@artheus /usr/local/bin
is read-only for CoreOS
modified artheus to use /opt/bin,
requires sudo
#!/bin/bash
mkdir -p /opt/bin
LATEST_URL=`curl -Ls -o /dev/null -w %{url_effective} https://github.com/docker/compose/releases/latest`
COMPOSE_VERSION=${LATEST_URL##*/}
DOWNLOAD_URL=https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m`
curl -L ${DOWNLOAD_URL} -o /opt/bin/docker-compose
chmod +x /opt/bin/docker-compose
The Container Linux Config (cl.conf
) based on daveneeley's conf which worked with:
- Ignition v2.2.0, Vagrant 2.2.4, VirtualBox v6.0.4r128413, HOST: macOS Mojave(OSX 10.14.4), GUEST: Container Linux by CoreOS stable (2023.5.0)
storage:
files:
- path: /opt/bin/docker-compose
filesystem: root
mode: 0755
contents:
remote:
url: https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64
verification:
hash:
function: sha512
sum: 5A9CCBE01CBF585732907F38FBACC21AECD2EDC9351BD1EE91DF750740A7FFF9D73BD489D708087D9D8892AD8F448A78A8EE401D240A51D0202ED0C08E30BF88
The complete conf (cl.conf)
Transpile it to config.ign
with ct
before use.
etcd:
name: "{HOSTNAME}"
listen_peer_urls: "http://{PRIVATE_IPV4}:2380"
listen_client_urls: "http://0.0.0.0:2379"
initial_advertise_peer_urls: "http://{PRIVATE_IPV4}:2380"
advertise_client_urls: "http://{PRIVATE_IPV4}:2379"
discovery: "https://discovery.etcd.io/<REPLACE HERE TO YOUR TOKEN>"
storage:
files:
- path: /opt/bin/docker-compose
filesystem: root
mode: 0755
contents:
remote:
url: https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64
verification:
hash:
function: sha512
sum: 5A9CCBE01CBF585732907F38FBACC21AECD2EDC9351BD1EE91DF750740A7FFF9D73BD489D708087D9D8892AD8F448A78A8EE401D240A51D0202ED0C08E30BF88
systemd:
units:
- name: docker-tcp.socket
enable: true
contents: |
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
Service=docker.service
BindIPv6Only=both
[Install]
WantedBy=sockets.target
- name: flanneld.service
dropins:
- name: 50-network-config.conf
contents: |
[Service]
ExecStartPre=/usr/bin/etcdctl set /flannel/network/config '{ "Network": "10.1.0.0/16" }'
flannel:
etcd_prefix: "/flannel/network"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version 1.14.0-rc1:
if you run into this exception after installing
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
you might wanna grant your current user the right permissions instead of using sudo:
sudo gpasswd -a ${USER} docker
This will add the current user to the group docker