0

I created a simple .deb package with fpm. The package is very basic and it simply runs a docker-compose file (see my other question here for package description).

I tried to specify that the package needs docker and docker-compose with:

fpm \
  -s dir -t deb \
  --deb-use-file-permissions \
  -p diagnosticator-0.1.0-1-any.deb \
  --name diagnosticator \
  --license agpl3 \
  --version 0.1.0 \
  --architecture all \
  --depends bash \
  --depends docker \
  --depends docker-compose \
  --description "Diagnosticator local app" \
  --url "https://diagnosticator.com" \
  --maintainer "Enrico Cocchi" \
  diagnosticator=/usr/bin/diagnosticator diagnosticator.1=/usr/share/man/man1/diagnosticator.1 docker-compose.yml=/usr/lib/diagnosticator/docker-compose.yml

but if I try to install it with sudo dpkg -i diagnosticator-0.1.0-1-any.deb:

dpkg: dependency problems prevent configuration of diagnosticator:
 diagnosticator depends on docker; however:
  Package docker is not installed.
 diagnosticator depends on docker-compose; however:
  Package docker-compose is not installed.

even if I have both installed and working for my user:

$ which docker
/usr/bin/docker

$ which docker-compose
/usr/local/bin/docker-compose

What am I doing wrong here?

1 Answer 1

1

Package dependencies are on package names, not binaries.

For docker, you can determine the appropriate package name by running

dpkg -S /usr/bin/docker

For docker-compose, you might need to create your own package first, or switch to the relevant package.

You might also want to install your package using apt install ./diagnosticator-0.1.0-1-any.deb instead of dpkg -i; that will try to resolve dependencies for you. Note too that your package file name should be diagnosticator_0.1.0-1_all.deb.

2
  • Thank you so much @StephenKitt for this answer. Would it be sufficient to put DOCKER_COMPOSE=/usr/local/bin/docker-compose; sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o $DOCKER_COMPOSE && sudo chmod +x $DOCKER_COMPOSE in my diagnosticator script (which are the instructions for docker-compose installation: docs.docker.com/compose/install) and add curl as dependency? Otherwise, how can I build my own package for docker-compose?
    – cccnrc
    Feb 12, 2022 at 20:30
  • 1
    sudo apt install docker-compose should give you a working /usr/bin/docker-compose; I suggest you use that (so the dependency in your package would be on docker-compose). Feb 12, 2022 at 22:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .