I have a Docker image and a cli tool. I want to create a Snap package that pulls the Docker image and run it on the local Docker. I already have a snapcraft.yaml that installs the cli tool. I'm trying to understand what should I add/edit so I can call Docker actions.
Additionally, I'm trying to understand if in such case the Docker must be installed via Snap or as long as Docker is somehow installed on the machine everything is fine? What happens when there is no Docker installed?
From what I'v found on Snap Docs, I need to add to my snapcraft.yaml the docker interface so it will provide access to the Docker deamon socket, but I can't find any resources how to call Docker commands...
This is my snapcraft.yaml:
version: '1.0.0'
summary: |
Test CLI and Service
description: |
Some Test Description.
grade: devel
confinement: strict
plugs:
docker-cli:
interface: docker
docker-executables:
interface: content
target: $SNAP/docker-exes
default-provider: docker:docker-executables
parts:
jre:
source-type: tar
source: ./jre-source/zulu11.33.10-sa-jre11.0.4-linux_x64.tar.gz
plugin: dump
test-snap:
source-type: local
source: ./test-snap-source
plugin: dump
apps:
test-snap:
command: docker ps
plugs:
- docker
- docker-executables
- docker-cli
When I run the test-snap I'm getting "/snap/test-snap/x6/command-test-snap.wrapper: 4: exec: docker: not found"
Thanks!