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

Provide RPM and DEB packages for compose #2235

Closed
dnephin opened this issue Oct 21, 2015 · 50 comments
Closed

Provide RPM and DEB packages for compose #2235

dnephin opened this issue Oct 21, 2015 · 50 comments

Comments

@dnephin
Copy link

dnephin commented Oct 21, 2015

Not everyone likes to install binaries (#1288).

It might be good to provide a system package for compose. We should use https://github.com/spotify/dh-virtualenv for the debian package and look into a similar approach for the rpm.

@jacek99
Copy link

jacek99 commented Oct 21, 2015

I would recommend to just work with the respective Debian and Fedora/CentOS communities and get that rolled into the default system repositories.'

Just my $0.02

@atrauzzi
Copy link

That ends up being less than optimal for a project that's moving as quickly as compose. You'll just end up with a pile of people coming in reporting that new features aren't working.

Better to have a PPA so that you can do updates outside of the distro release cycle.

@dnephin
Copy link
Author

dnephin commented Oct 27, 2015

It sounds like there is a deb for it (https://packages.debian.org/sid/docker-compose) but it's already a few versions behind.

@dnephin
Copy link
Author

dnephin commented Oct 27, 2015

@ghost
Copy link

ghost commented Oct 31, 2015

Couldn't this be done in the same way as https://docs.docker.com/installation/ubuntulinux/ and https://docs.docker.com/installation/fedora/? i.e. host on *.docker.org

@dnephin
Copy link
Author

dnephin commented Nov 2, 2015

Hosting the packages is the easy part. Most of the work here is making sure the package works for older versions of distros.

@athyuttamre
Copy link

Would you consider doing this once development pace has stabilized?

@StefanScherer
Copy link
Member

What about putting the docker-compose binary that is also available at the GH release into DEB/RPM?
No python/virtualenv required on the target machine.

Creating such a package with fpm should be very easy. We've done similar things at work (sorry private repos) and put some integration tests behind the build to test the DEB/RPM package at CircleCI within debian/centos Docker containers.

If there is interest in such things I can check if we can open source that parts as an example.

@alexanderadam
Copy link

I totally agree that it would nice to have it packaged but for ubuntu I don't think it's useful to add another PPA. I would rather like to see current docker compose in the already existing repository.

@dnephin apt repositories can have different packages per distribution anyway and as the other docker packages are already included it even should be easier to manage that compose and docker work nicely together.

Therefore I think providing automatic builds for the official docker repos should be in focus here (and not creating additional repositories).

@atrauzzi
Copy link

@alexanderadam That's a good way to get outdated bug reports. A PPA makes much more sense for a target that moves as quickly as docker+compose.

Indeed that's why people prefer to use the docker PPA. What's in the ubuntu/debian repos just doesn't keep pace.

@mkantor
Copy link

mkantor commented May 15, 2016

@atrauzzi unless I'm misreading, @alexanderadam is suggesting to host docker-compose in the docker repository (https://apt.dockerproject.org/), not rely on the the ubuntu/debian packagers.

@atrauzzi
Copy link

Good enough! :)

@ksylvan
Copy link

ksylvan commented Aug 16, 2016

There is also this possibility. Run this shell script as docker-compose:

#!/bin/sh

if [ -t 0 ]; then OPTS='-it'; fi

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
       -v "$(pwd):$(pwd)" -w "$(pwd)" \
       $OPTS dduportal/docker-compose:latest ${1+"$@"}

@FranklinYu
Copy link

@ksylvan Why ${1+"$@"} instead of just "$@"?

@Gaff
Copy link

Gaff commented Sep 20, 2016

Also docker-machine while you're working on it?

@nevergone
Copy link

What would there be need for in order for the solution of the issue to go on?

@alexanderadam
Copy link

I doubt that anybody from the Docker team had a look on it.

@fsateler, in case you are the packager of the Debian package: is there anything particular to think of when packaging docker-compose as an Debian package (sorry for mentioning).

@fsateler
Copy link

@alexanderadam yes, I am the downstream maintainer. I would of course be delighted to have help maintaining the debian package, but if you want to maintain an out-of-band package that is fine too.

If you go the out-of-band way, please consider the following:

  1. Packages from such repositories should work with multiple releases (usually debian and ubuntu, in their various releases).
  2. This means relying on distro-provided packages is harder. For example, a required version of a python module might not yet be available.
  3. Care should be taken to not step over distro-provided packages (that is, overwrite a module with a newer version).

The linked dh-virtualenv above looks like it addresses the above three problems by shipping the complete venv into /opt. All that should be required then is to use the oldest supported disro release to build the packages, this seems a requirement of dh-virtualenv.

The alternative would be to have multiple repositories for the different releases, but that would be IMO much more trouble than it is worth.

PS: yes, the debian package is a bit behind, but that is mostly resolved, hopefully (we have now 1.8.0). We were stuck a while waiting for newer versions of some dependent modules.

@gyszalai
Copy link

I think providing a snap or flatpak package could solve the dependency issues. Opinions?

@jasonmp85
Copy link

So why isn't there already at least just a package with the binary in it? After poking around how exactly this binary is generated, it appears it's dynamically linked, so I guess there are concerns about breaking compatibility with older distros, but right now your "upgrade" steps are basically "blast over the old binary and hope it works", so I don't particularly see that as any sort of regression (i.e. the dependencies aren't specified as-is, and neither are compatible distros, so slapping the binary into a package would be no worse than the current scenario, and in some ways actually better, since it permits users to install docker and compose in one line rather than two separate ways).

I guess compose is kind of a dev tool in the first place, but it would be nice to see a better install story.

@alexanderadam
Copy link

alexanderadam commented Feb 24, 2017

So why isn't there already at least just a package with the binary in it?

@jasonmp85 just to clear this up: as mentioned earlier there are actually packages and fsateler (maintainer of the current Debian packages) wrote that he would be more than happy if someone could support him maintaining these packages. And if you don't need the latest Docker binaries you will be probably fine if you just use them together with the Docker binaries provided by your Distro (and you get security updates via your package manager as well).

However, there are a bunch of good reasons to prefer the current version of Docker. Which was most probably the motivation why the Docker people created a PPA and wrote that you should use it. But docker-compose is missing here.

PS: I don't quite understand why issue 24210 was closed. I agree that there is tooling required first (so this issue here is a dependency for 24210) but this shouldn't be a reason to close this issue, right?

@sweepies
Copy link

sweepies commented Mar 27, 2019

Maintaining separate deb/rpm/whatever packages for each version of a distribution is extra work no one needs.

There are lots of operating environments that cannot use a 3rd party package manager such as Snap due to policy controls. Without going into too much detail, think GOVT sites, etc...
So while snaps are great for independent devs and other freewheeling environments, they are not an actual replacement to OS-native/Distro-native packages such as .deb/.rpm.

How about both? 😛

---

For anyone looking to use this:

There is also this possibility. Run this shell script as docker-compose:

#!/bin/sh

if [ -t 0 ]; then OPTS='-it'; fi

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
       -v "$(pwd):$(pwd)" -w "$(pwd)" \
       $OPTS dduportal/docker-compose:latest ${1+"$@"}

the dduportal/docker-compose image hasn't been updated since 1.12.0, and there is now an official docker/compose image.

Use this instead (requires jq to be installed, or alias jq to also run with docker):

#!/bin/sh

if [ -t 0 ]; then OPTS='-it'; fi

latest=$(curl -s https://registry.hub.docker.com/v2/repositories/docker/compose/tags/ | jq -r '.results[0].name')

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
       -v "$(pwd):$(pwd)" -w "$(pwd)" \
       $OPTS docker/compose:"$latest" ${1+"$@"}

Note that this includes release candidate versions.

The following script does not include prereleases, but fetches the release from GitHub instead of directly from the Docker Hub (so it's possible the tag won't exist on the Docker Hub):

#!/bin/sh

if [ -t 0 ]; then OPTS='-it'; fi

latest=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name')

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
       -v "$(pwd):$(pwd)" -w "$(pwd)" \
       $OPTS docker/compose:"$latest" ${1+"$@"}

This isn't ideal since there is no latest tag (until #6553) and the API request will take extra time, but it works.

@stale
Copy link

stale bot commented Oct 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 9, 2019
@FranklinYu
Copy link

I would say let's close it since Docker team clearly isn't interested given that we don't hear from them for more than 3 years. Community cannot do anything because we don't control the repository. We have enough workaround above.

@stale
Copy link

stale bot commented Oct 10, 2019

This issue has been automatically marked as not stale anymore due to the recent activity.

@cefn
Copy link

cefn commented Feb 27, 2020

For reference, following the most recent suggestion from @sweepyoface in #2235 (comment) on my system at least, access to /var/run/docker.sock requires sudo

Without prefixing the docker-compose command with sudo...

$ /home/cefn/.local/bin/docker-compose --help
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

Update: responding to @oxydaemon's comment below:

'You need to use sudo to run Docker commands.'
https://docs.docker.com/install/linux/docker-ce/debian/

The information at https://docs.docker.com/install/linux/linux-postinstall/ shows how to manage access to docker through groups (instead of sudo). However note 'The docker group grants privileges equivalent to the root user' ( https://docs.docker.com/install/linux/linux-postinstall/ ) so until this is mitigated I'll personally keep using sudo.

@oxydaemon
Copy link

For reference, following the most recent suggestion from @sweepyoface in #2235 (comment) on my system at least, access to /var/run/docker.sock requires sudo

Without prefixing the docker-compose command with sudo...

$ /home/cefn/.local/bin/docker-compose --help
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

You shouldn't need sudo, that is permission denied error to docker.sock.
Assuming you're running as user 'cefn', did you add that user to the docker group in /etc/group?

username@myserver:~$ ls -l /var/run/docker.sock
srw-rw---- 1 root docker 0 Feb 27 14:33 /var/run/docker.sock

docker group members have read and write permissions

@cefn
Copy link

cefn commented Feb 27, 2020

I switch to installing with pip within a venv, and aliasing docker-compose to the binary within that venv ... it depends only on python3-venv.

The alternative https://docs.docker.com/compose/install/ under 'Alternative Install Options' is even simpler, and doesn't rely on python3-venv either...

sudo pip install docker-compose

Unfortunately 'Alternative Install Options' is set against tabs for 'Windows, Mac OS, Linux'. The Linux tab contains only curl-based instructions, (which swing free from software repositories or updates).

I'd personally like to see 'install Pip' then 'pip install docker-compose' under the Linux tab. However, perhaps hiding the pip approach as an 'Alternative Install' is to avoid having to provide multi-os guidance how to install pip.

@stale
Copy link

stale bot commented Aug 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 25, 2020
@epoctic
Copy link

epoctic commented Aug 27, 2020

Unstale this.

@stale
Copy link

stale bot commented Aug 27, 2020

This issue has been automatically marked as not stale anymore due to the recent activity.

@stale stale bot removed the stale label Aug 27, 2020
@stale
Copy link

stale bot commented Feb 23, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 23, 2021
@francislavoie
Copy link

francislavoie commented Feb 23, 2021

Unstale this, again 🙄.

@stale
Copy link

stale bot commented Feb 23, 2021

This issue has been automatically marked as not stale anymore due to the recent activity.

@stale stale bot removed the stale label Feb 23, 2021
@francislavoie
Copy link

francislavoie commented May 25, 2021

Well, it looks like the move to bundling compose in the main docker-ce package eventually should help: https://docs.docker.com/compose/cli-command/ and https://github.com/docker/compose-cli, but I still find it shocking that this hasn't been addressed yet 😞

@velovix
Copy link

velovix commented May 26, 2021

That is encouraging, but do we know yet if there are plans to include this on Linux by default after this gets past the preview? It appears to be included in edge releases for Windows and Mac, but not Linux. If you want to install it currently, you have to run a shell script.

@MAFLO321
Copy link

MAFLO321 commented Dec 1, 2021

is connected to #8011

@MAFLO321
Copy link

I think this can be closed:

@thaJeztah
Copy link
Member

Yes! Let's close this

(additional documentation changes still to follow)

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