dockergitlabgitlab-cisnapcraft

snap and gitlab-CI: error: cannot communicate with server: Post http://localhost/v2/snaps/hello-world


If I try to run snap under a gitlab-CI pipeline, installing the most simple package, it fails with:

$ snap install hello-world

error: cannot communicate with server: Post http://localhost/v2/snaps/hello-world: dial unix /run/snapd.socket: connect: no such file or directory

The gitlab-ci yml configuration file is the simplest ever:

image: ubuntu:18.04

before_script:
  - apt-get update -qq

test:
  script:
    - apt-get install -y snapd
    - snap version
    - snap install hello-world
    - hello-world

What's going on?


Solution

  • Seems GithubActionsCI doesn't use Docker so I'm using this now instead of GitLabCI, to build and test snap packages.

    Just note: