Hello everyone,
I’m trying to create a snap that deploys some Docker containers using “docker-compose,” but I’m encountering some issues… I’m attaching my snapcraft.yaml:
name: q-deployer
base: core22
version: '0.1'
summary: q-deployer
description: |
q-deployer
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
parts:
scripts:
plugin: dump
source: ./scripts
envsubst:
plugin: nil
stage-packages: [gettext-base]
stage: [usr/bin/envsubst]
q-deployer:
plugin: nil
source: .
source-type: local
override-build: |
mkdir -p $SNAPCRAFT_PART_INSTALL/edl
cp -R snap/local/images $SNAPCRAFT_PART_INSTALL/edl/
cp -R snap/local/traefik_template $SNAPCRAFT_PART_INSTALL/edl/
cp snap/local/docker-compose.yml $SNAPCRAFT_PART_INSTALL/edl/
apps:
q-deployer:
command: ./start.sh
stop-command: ./stop.sh
restart-delay: 1m
restart-condition: on-failure
daemon: simple
install-mode: disable
plugs:
- docker
- docker-executables
- network
- network-setup-observe
- network-observe
plugs:
docker-executables:
interface: content
target: $SNAP/docker-exes
default-provider: docker:docker-executables
By using the docker-executables
plug, I can see the Docker binaries of my machine. I can easily run commands based on “docker” (e.g., docker run, docker load, etc.), but when I try to run a command based on “docker-compose,” the following happens:
root@devbook:/snap/q-deployer/x1# docker-exes/bin/docker-compose
Traceback (most recent call last):
File "/snap/q-deployer/x1/docker-exes/bin/docker-compose", line 33, in <module>
sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
File "/snap/q-deployer/x1/docker-exes/bin/docker-compose", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 969, in distribution
return Distribution.from_name(distribution_name)
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for docker-compose
I want to mention that I’m currently using this version of Docker:
docker 20.10.17 2750 core18/stable canonical✓ -
I’m aware that it’s a quite old version, but it’s the only one currently compatible with my target machine.
Can you help me understand what the issue might be? PLEASE!