How to install docker-compose on Fedora CoreOS
Why don't you just install the docker-compose package directly? As the Fedora package maintainer for docker-compose I try to make sure this works for all Fedora users.
[core@localhost ~]$ sudo rpm-ostree install docker-compose
Checking out tree 318de83... done
Enabled rpm-md repositories: fedora-cisco-openh264 updates fedora updates-archive
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2020-08-25T19:05:18Z
rpm-md repo 'updates' (cached); generated: 2020-12-13T02:23:33Z
rpm-md repo 'fedora' (cached); generated: 2020-04-22T22:22:36Z
rpm-md repo 'updates-archive' (cached); generated: 2020-12-13T04:16:16Z
Importing rpm-md... done
Resolving dependencies... done
Will download: 40 packages (15.8 MB)
Downloading from 'updates'... done
Downloading from 'fedora'... done
Importing packages... done
Checking out packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Added:
docker-compose-1.25.4-1.fc32.noarch
gdbm-libs-1:1.18.1-3.fc32.x86_64
libsodium-1.0.18-3.fc32.x86_64
libxcrypt-compat-4.4.17-1.fc32.x86_64
python-pip-wheel-19.3.1-4.fc32.noarch
python-setuptools-wheel-41.6.0-2.fc32.noarch
python-unversioned-command-3.8.6-1.fc32.noarch
python3-3.8.6-1.fc32.x86_64
python3-attrs-19.3.0-2.fc32.noarch
python3-bcrypt-3.1.7-4.fc32.x86_64
python3-cached_property-1.5.1-7.fc32.noarch
python3-cffi-1.14.0-1.fc32.x86_64
python3-chardet-3.0.4-15.fc32.noarch
python3-cryptography-2.8-3.fc32.x86_64
python3-docker-4.2.0-1.fc32.noarch
python3-docker-pycreds-0.4.0-6.fc32.noarch
python3-dockerpty-0.4.1-18.fc32.noarch
python3-docopt-0.6.2-16.fc32.noarch
python3-fluidity-sm-0.2.0-18.fc32.noarch
python3-idna-2.8-6.fc32.noarch
python3-invoke-1.4.1-1.fc32.noarch
python3-jsonschema-3.2.0-2.fc32.noarch
python3-lexicon-1.0.0-10.fc32.noarch
python3-libs-3.8.6-1.fc32.x86_64
python3-paramiko-2.7.1-2.fc32.noarch
python3-pip-19.3.1-4.fc32.noarch
python3-ply-3.11-7.fc32.noarch
python3-pyOpenSSL-19.0.0-6.fc32.noarch
python3-pyasn1-0.4.8-1.fc32.noarch
python3-pycparser-2.19-2.fc32.noarch
python3-pynacl-1.3.0-6.fc32.x86_64
python3-pyrsistent-0.16.0-1.fc32.x86_64
python3-pysocks-1.7.1-4.fc32.noarch
python3-pyyaml-5.3.1-1.fc32.x86_64
python3-requests-2.22.0-8.fc32.noarch
python3-setuptools-41.6.0-2.fc32.noarch
python3-six-1.14.0-2.fc32.noarch
python3-texttable-1.6.2-5.fc32.noarch
python3-urllib3-1.25.7-3.fc32.noarch
python3-websocket-client-0.56.0-6.fc32.noarch
Run "systemctl reboot" to start a reboot
Remember that in order to use Docker (without sudo
) your user must be in the docker
group. By default the CoreOS core
user is not in this group.
[core@localhost ~]$ sudo usermod -aG docker core
After you log out and log back in, confirm your user is in the docker
group.
[core@localhost ~]$ id
uid=1000(core) gid=1000(core) groups=1000(core),4(adm),10(wheel),16(sudo),190(systemd-journal),978(docker) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Now you can use docker-compose.
[core@localhost ~]$ cd composetest/
[core@localhost composetest]$ docker-compose up
Creating network "composetest_default" with the default driver
Building web
Step 1/10 : FROM python:3.7-alpine
...
web_1 | * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)