Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release docker/compose image for armv7 / arm64v8 #6831

Closed
maruel opened this issue Aug 2, 2019 · 37 comments
Closed

Release docker/compose image for armv7 / arm64v8 #6831

maruel opened this issue Aug 2, 2019 · 37 comments

Comments

@maruel
Copy link

maruel commented Aug 2, 2019

Is your feature request related to a problem? Please describe.

Using curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" > docker-compose
fails on Raspbian as described in issue #6810.

The root causes are:

While issue #6810 was closed, I think this is a genuine feature request since instructions at https://docs.docker.com/compose/install/#install-as-a-container are not clear about which platforms are officially supported to run docker-compose as a container.

Two recent events may now make this worth:

  • The new RPi4 has real 1Gbit ethernet. It becomes a real platform for hobbyist with limited linux experience using Raspbian to host images.
  • Docker Hub has real native support for multi-arch images via manifest v2.

Combined with the fact that docker-compose is a core building block for orchestrating images, the lack of support on arm v7 (32 bits) and v8 (64 bits) makes the bootstrapping process options more limited than on x86 equivalent and the documentation is not clear about which options work where.

As stated at #4733 (comment), there used to be a Dockerfile.armhf. This file was deleted in #6666 by @joakimr-axis since the current one works just fine.

Describe the solution you'd like

Officially create armv7 and arm64v8 docker images to https://hub.docker.com/r/docker/compose as part of the release process.

This is essentially a process change, not a code change, since the Dockerfile is known to work on arm already. This would involve at the very least updating .circleci/config.yml.

Describe alternatives you've considered

Installing via pip works in the meantime but is trickier to run this process successfully for new comers with limited linux experience, especially that the documentation is misleading about what is supported and what is not. This leads to a poor user experience (UX).

@webash
Copy link

webash commented Nov 26, 2019

As a new user to Docker, hoping to make my Raspberry Pi 4 the test ground for learning Docker, this stumbling block has been impossible to get past. Every tutorial uses docker-compose and the fact that it seems impossible to obtain easily has wasted hours of my time.

There is no clear reason why this isn't the case. It should at least be called out in the installation documentation in the meantime.

For those trying to understand why it is so hard: there is no official documentation for getting Docker (and compose!) up and running on an RPI. The general Linux guidance doesn't work. There are hundreds of tutorials out there, all of them of varying ages (the older ones being most wrong), all with varying levels of self-described 'easy' steps, most of them involving what can only be best described as hacks. I just wanted a little bit of a home project to learn a new technology. Instead I've wasted my time frustratingly. KISS principles do not appear to have been followed here.

@nemchik
Copy link

nemchik commented Nov 26, 2019

@webash I'm sorry to hear you've had troubles installing compose. You should be able to do it pretty easily by installing python3 and python3-pip first and then running python3 -m pip install -IU docker-compose.

If you have further issues feel free to reach out via my contact info on my GitHub profile since this isn't really a support thread.

That being said I'm subscribed here hoping to see any kind of movement in this happening. I'd love to he able to run compose from docker on ARM. It works great on x86_64.

@webash
Copy link

webash commented Dec 3, 2019

Python dependencies and the share number of them for docker-compose is a crime to install directly on a machine where containers will be used; so I ended up following these instructions for getting a docker-compose container spun up on the Raspberry Pi.

@nemchik
Copy link

nemchik commented Dec 3, 2019

Interestingly those instructions use a Dockerfile from this very repo. I'm pretty sure all we're asking for is an armhf tag on docker hub. Maybe a multiarch manifest if the devs are feeling fresh 😉

@joakimr-axis
Copy link

Yes, multiarch would surely be the contemporary way.

@Ivan61
Copy link

Ivan61 commented Dec 25, 2019

@webash

I had built it on my Raspberry Pi 3 Model B Rev 1.2 with Raspbian10 (buster) [arm/v7].
You can try to do it on your Raspberry Pi 4.

pi@raspberrypi:~ $ git clone https://github.com/docker/compose.git
pi@raspberrypi:~ $ cd compose/
pi@raspberrypi:~/compose $ git checkout -f 1.25.0
pi@raspberrypi:~/compose $ sudo docker build -t dockercompose:1.25.0 .
pi@raspberrypi:~ $ sudo curl -L --fail https://github.com/docker/compose/releases/download/1.25.0/run.sh -o /usr/local/bin/docker-compose
pi@raspberrypi:~ $ sudo chmod +x /usr/local/bin/docker-compose
pi@raspberrypi:~ $ sudo sed -i 's/docker\/compose:$VERSION"/dockercompose:$VERSION"/g' /usr/local/bin/docker-compose
pi@raspberrypi:~ $ sudo docker-compose version
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019

I have the following images after docker build.

pi@raspberrypi:~ $ sudo docker images
REPOSITORY          TAG                     IMAGE ID            CREATED              SIZE
dockercompose       1.25.0                  9272a0512c9e        16 seconds ago       56.6MB
<none>              <none>                  d4b17be57ec2        About a minute ago   470MB
<none>              <none>                  a164b2c19a32        31 minutes ago       306MB
python              3.7.4-slim-stretch      c8a29540aa80        2 months ago         112MB
python              3.7.4-alpine3.10        6fcdf3f2e43b        2 months ago         76.6MB
debian              stretch-20190812-slim   9e643d1c5544        4 months ago         41.5MB
docker              18.09.7                 1661b80f3a8a        5 months ago         140MB
alpine              3.10.1                  962e8b19ad7b        5 months ago         3.74MB

The executable docker-compose binary file is inside dockercompose:1.25.0. alpine:3.10.1 is the base image of dockercompose:1.25.0. The other images are useless anymore. You can delete them.

And don't try to copy it to Raspberry Pi and use it directly. Because it depends on other shared library inside dockercompose:1.25.0.

It takes 40mins to build it on my Raspberry Pi 3. I had uploaded it to my docker-hub. If anyone want to use it on Raspberry Pi 3(arm/v7), please refer here.

masnagam added a commit to masnagam/install-docker-compose that referenced this issue Feb 22, 2020
masnagam added a commit to masnagam/install-docker-compose that referenced this issue Feb 22, 2020
masnagam added a commit to masnagam/install-docker-compose that referenced this issue Feb 22, 2020
@nemchik
Copy link

nemchik commented May 24, 2020

https://hub.docker.com/r/linuxserver/docker-compose

Hopefully this helps anyone waiting for an official response.

@JonahGroendal
Copy link

sudo apt install docker-compose works but it installs an older version (currently 1.25.0)

@Ghada-Ch
Copy link

Ghada-Ch commented Jul 4, 2020

@Ivan61

sudo docker-compose version

Unable to find image 'dockercompose:1.25.0' locally
docker: Error response from daemon: pull access denied for dockercompose, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

@apiraino
Copy link

apiraino commented Jul 4, 2020

@JonahGroendal @Ghada-Ch please also have a look at this comment (I could build Compose from sources for a Raspi4 on Ubuntu server ARM64)

@shukriadams
Copy link

shukriadams commented Aug 15, 2020

There are official, up-to-date raspbian builds for docker core ...

https://download.docker.com/linux/raspbian/dists/buster/pool/stable/armhf

but not for compose? Why is that?

@nemchik
Copy link

nemchik commented Aug 15, 2020

There are official, up-to-date raspbian builds for docker core ...

https://download.docker.com/linux/raspbian/dists/buster/pool/stable/armhf

but not for compose? Why is that?

Compose installs via pip, which works fine on arm. This issue it's specifically about the lack of an official docker image built for arm.

@shukriadams
Copy link

Last time I checked compose wants python 3, while raspbian's global python is still 2. apt-get install docker-compose is still the cleanest compromise, but then we end up with an older version of it. Look, it's not the end of the world, I just can't help feeling the general docker experience on ARM/Raspbian still lags behind what I'm used to on mainstream cpus/distros.

@shainert-israel
Copy link

What are the instructions for installing docker-compose on Yocto?

@nemchik
Copy link

nemchik commented Aug 31, 2020

Last time I checked compose wants python 3, while raspbian's global python is still 2. apt-get install docker-compose is still the cleanest compromise, but then we end up with an older version of it. Look, it's not the end of the world, I just can't help feeling the general docker experience on ARM/Raspbian still lags behind what I'm used to on mainstream cpus/distros.

Echoing the Recommended method from https://hub.docker.com/r/linuxserver/docker-compose

sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Should work on any linux distro and should work on x86_64, armv7l/armhf, and aarch64/armv8/arm64 if you already have docker installed.

Edit:
To be clear this runs compose inside a container and does not require installing python on the host system.

@Hecatron
Copy link

I've been using docker and docker-compose on gentoo-on-rpi-64bit on a pi4.
Although I'd recommend also using hard disks and not just an sd card in that scenario. (I'm using a X829 geekworm board as part of that)
Since gentoo tends to build stuff from source sometimes

Although gentoo-on-rpi-64bit is setup to use binary / precompiled ebuilds in most cases.
So far they have 1.27.0 of docker-compose available in the ebuilds although setting up the OS is more technical / not as pre-packaged as raspian. but it is ARM64

@tlex
Copy link

tlex commented Sep 26, 2020

I've been building a multi-arch image for quite some time now - only running docker buildx against the Dockerfile in this repository.

If anyone wants to give it a spin: gitlab.com/ix.ai/docker-compose or ixdotai/docker-compose

@shainert-israel
Copy link

For Yocto Thud I managed to use docker-compose, but I needed to cheat it, so I guess some features might not work (reviewing the change log, it looks OK to me). Any one can print out what will not work?
My Environment:
BB_VERSION = "1.40.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-fslc-linux-gnueabi"
MACHINE = "imx6ul-var-dart"
DISTRO = "fslc-framebuffer"
DISTRO_VERSION = "2.6"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard"
TARGET_FPU = "hard"
In conf/local.conf:
IMAGE_INSTALL_append += " python3-docker-compose"
In sources/meta-xxx/recipes-containers/docker-compose/python3-docker-compose_%.bbappend:
do_install_append() { sed -e 's/docker<3.0,>=2.5.1/docker<3.5,>=2.5.1/g' ${D}${libdir}/python3.5/site-packages/docker_compose-1.16.1-py3.5.egg-info/requires.txt > mod_req.txt install -d ${D}${libdir}/python3.5/site-packages/docker_compose-1.16.1-py3.5.egg-info install -m 0644 mod_req.txt ${D}${libdir}/python3.5/site-packages/docker_compose-1.16.1-py3.5.egg-info/requires.txt }

@samip5
Copy link

samip5 commented Oct 14, 2020

I've been using docker and docker-compose on gentoo-on-rpi-64bit on a pi4.
Although I'd recommend also using hard disks and not just an sd card in that scenario. (I'm using a X829 geekworm board as part of that)
Since gentoo tends to build stuff from source sometimes

Although gentoo-on-rpi-64bit is setup to use binary / precompiled ebuilds in most cases.
So far they have 1.27.0 of docker-compose available in the ebuilds although setting up the OS is more technical / not as pre-packaged as raspian. but it is ARM64

Unfortunately, if you run the Sakaki's version of Gentoo, you'll find it hard to find support from Gentoo's normal support channels.

@logoff
Copy link

logoff commented Jan 7, 2021

In this case I prefer to have the binary, so my solution is using LinuxServer release. They affirm they provide them:

Binaries
We are also providing the binaries for both docker-compose and docker-cli for all three arches in Github releases. You can download the correct binaries for your arch directly and drop into /usr/local/bin/.

For my Raspbian:

curl -L https://github.com/linuxserver/docker-docker-compose/releases/download/1.29.2-ls43/docker-compose-armhf | sudo tee /usr/local/bin/docker-compose >/dev/null

EDIT: command using tee and last version available (1.28.2-ls30)
EDIT2: last version available (1.28.5-ls32)
EDIT3: last version available (1.29.2-ls39)
EDIT4: last version available (1.29.2-ls41)
EDIT5: last version available (1.29.2-ls43)

@neodon
Copy link

neodon commented Feb 22, 2021

I just ran into this issue again after a few months, and was surprised again that I can't get the latest version of docker-compose in the same way for x86_64 and aarm64.

@pcgeek86
Copy link

I'm running 64-bit Ubuntu 20.04 LTS Focal Fossa on a Raspberry Pi 3 B+. Is there an official ARM 64-bit binary for Docker Compose?

@nemchik
Copy link

nemchik commented Mar 13, 2021

I'm running 64-bit Ubuntu 20.04 LTS Focal Fossa on a Raspberry Pi 3 B+. Is there an official ARM 64-bit binary for Docker Compose?

Unfortunately no, there isn't an official one, but linuxserver.io has one that is a near identical clone of the x86 official with added support for armhf and aarch64 #6831 (comment)

@javierguzman
Copy link

Does anyone know if they plan to release this for arm or is it directly a no no?

I wanted to port my Gitlab CI to Raspberry PI and stumbled upon this problem.

Thank you in advance and regards.

@darkguy2008
Copy link

2021 yet no progress on this. What's the status? How do we install it then?

@darkguy2008
Copy link

@webash I'm sorry to hear you've had troubles installing compose. You should be able to do it pretty easily by installing python3 and python3-pip first and then running python3 -m pip install -IU docker-compose.

If you have further issues feel free to reach out via my contact info on my GitHub profile since this isn't really a support thread.

That being said I'm subscribed here hoping to see any kind of movement in this happening. I'd love to he able to run compose from docker on ARM. It works great on x86_64.

This is cool and it works to install it, but it doesn't work if you use sudo to run it. Anybody knows how to? Thanks!

@VennieSo
Copy link

2021 yet no progress on this. What's the status? How do we install it then?

Check out #6831 (comment) to run compose in a container or #6831 (comment) to download the binary, both solutions by LinuxServer.

@williamdes
Copy link

2021 yet no progress on this. What's the status? How do we install it then?

Source: https://withblue.ink/2020/06/24/docker-and-docker-compose-on-raspberry-pi-os.html

# Install required packages
sudo apt update
sudo apt install -y python3-pip libffi-dev

# Install Docker Compose from pip (using Python3)
# This might take a while
sudo pip3 install docker-compose

@boonya
Copy link

boonya commented Apr 27, 2021

2021 yet no progress on this. What's the status? How do we install it then?

Source: https://withblue.ink/2020/06/24/docker-and-docker-compose-on-raspberry-pi-os.html

# Install required packages
sudo apt update
sudo apt install -y python3-pip libffi-dev

# Install Docker Compose from pip (using Python3)
# This might take a while
sudo pip3 install docker-compose

This is what exactly I use for my pet project. And this has been working for a long time with no issues.

But also I had to include libssl-dev and... I don't know why ) So, it may help in some cases I think.

@nemchik
Copy link

nemchik commented Apr 27, 2021

To be clear, installing compose via pip does work, but it is not running compose itself from within a docker container, which is the topic of this issue. Options exist from 3rd parties to accomplish running compose from within docker, and comments above have outlined these options. One such posted by me: #6831 (comment)

@jamshid
Copy link

jamshid commented Apr 30, 2021

I guess we should be switching from docker-compose to docker compose but fwiw here's what I had to do to build an ARM64-compatible image based on centos:7.9.2009 that includes a working docker-compose.

# Can test with: docker run -ti --platform linux/arm64 centos:7.9.2009 bash
FROM centos:7.9.2009
RUN yum install python3-pip
...
# Install docker-compose client
ENV DOCKER_COMPOSE_VERSION 1.29.0
RUN test "$(uname -m)" = "aarch64" && echo INSTALL LATER VIA PIP UNTIL ARM64 BINARIES AVAILABLE OR SWITCH TO docker compose && exit 0 ; curl -sSLf -o /bin/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` && chmod +x /bin/docker-compose
# Temporary arm64 support, remove after switching to "docker compose"
RUN if test "$(uname -m)" = "aarch64" ; then pip3 install --upgrade pip && yum install -y make gcc python3-devel && pip3 install pynacl && pip3 install docker-compose==${DOCKER_COMPOSE_VERSION} && yum remove -y make gcc python3-devel ; fi

tillkuhn added a commit to tillkuhn/angkor that referenced this issue Jun 5, 2021
…rflow.com/a/65062795/4292075 which lead to missing docker-compose after cloud-init (missing make?)
@ndeloof
Copy link
Contributor

ndeloof commented Jun 17, 2021

Please note compose v2 has arm7 and arm64 binaries: https://github.com/docker/compose-cli/releases/tag/v2.0.0-beta.3

@rafaelmaeuer
Copy link

2021 yet no progress on this. What's the status? How do we install it then?

Source: https://withblue.ink/2020/06/24/docker-and-docker-compose-on-raspberry-pi-os.html

# Install required packages
sudo apt update
sudo apt install -y python3-pip libffi-dev

# Install Docker Compose from pip (using Python3)
# This might take a while
sudo pip3 install docker-compose

Is there a benefit in means of performance and stability compared to the solution of @nemchik: #6831 (comment)?

@nemchik
Copy link

nemchik commented Aug 1, 2021

2021 yet no progress on this. What's the status? How do we install it then?

Source: https://withblue.ink/2020/06/24/docker-and-docker-compose-on-raspberry-pi-os.html

# Install required packages
sudo apt update
sudo apt install -y python3-pip libffi-dev

# Install Docker Compose from pip (using Python3)
# This might take a while
sudo pip3 install docker-compose

Is there a benefit in means of performance and stability compared to the solution of @nemchik: #6831 (comment)?

Currently the options to run docker-compose on any system are:

  • Install python and then install docker-compose
  • On x86_64, use the official docker/compose image with the official helper script
  • On x86_64, armv7, or armv8, use the linuxserver/docker-compose image (based on the official `docker/compose image, but built for multiple architectures) with the linuxserver helper script (based on the official helper script, but using the linuxserver image).

In the future https://github.com/docker/compose-cli may replace the need for most of this, but it seems like the application in this repo is currently recommended for general use.

Edit: there are also more options to run docker-compose others have mentioned here, and even more if you go searching Google I'm sure.

@JohnnyLin-a
Copy link

JohnnyLin-a commented Aug 2, 2021

An easy way to get Docker compose running:
Download Docker on your arm device. (Latest stable pref)
Download v2.x docker-compose-linux-armv7 from the releases page (or the one that matches your device's architecture)
Rename that file to just docker-compose
Move docker-compose to ~/.docker/cli-plugins/ and chmod +x ~/.docker/cli-plugins/docker-compose
Then the command docker compose will work on your device.

Edit:
docker compose v2 stable release is out for most cpu architectures (21-09-28)

@ndeloof ndeloof closed this as completed Sep 30, 2021
@l3043Y
Copy link

l3043Y commented Nov 17, 2021

arm64 or aarch64

mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.0.1/docker-compose-linux-aarch64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
docker compose version

@ASFLY61
Copy link

ASFLY61 commented Nov 18, 2021

arm64 or aarch64

mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.0.1/docker-compose-linux-aarch64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
docker compose version

Thank you very much

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

No branches or pull requests