← Back to issue list

How do I install build-snaps when running through Docker?

View original Github issue

Metadata

Project
snapcraft-rocks
Number
#110
Type
issue
State
closed
Author
Wesztman
Labels
—
Created
Updated
Closed

Current evaluation

Docker images lack a running snapd; build-snaps must be downloaded and extracted into /snap manually. The residual Snapcraft warning is harmless when builds succeed.

Resolution: closed not a bug

Reason: In maintainer comments on October 16, @brunvonlope confirmed that normal snap installation is unavailable without snapd, provided a manual download-and-unsquashfs solution, and explained that the remaining warning does not prevent successful builds. The author confirmed the workaround on October 17; no code fix was required.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Hi there! I tried running ``` docker run -it -v `pwd`:/project ghcr.io/canonical/snapcraft:8_core22 pack ``` but my snapcraft.yaml contains a couple of `build-snaps` and all these seems to be missing 🤔 ``` 2025-10-15T10:55:24.453Z [pebble] {"type":"security","datetime":"2025-10-15T10:55:24Z","level":"WARN","event":"sys_startup:0","description":"Starting daemon","appid":"pebble"} 2025-10-15T10:55:24.453Z [pebble] Started daemon. 2025-10-15T10:55:24.481Z [pebble] POST /v1/services 14.069963ms 202 (http+unix) 2025-10-15T10:55:24.496Z [pebble] Service "snapcraft" starting: /bin/run-snapcraft.sh [ pack ] 2025-10-15T10:55:24.502Z [snapcraft] 2025-10-15T10:55:24.502Z [snapcraft] WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 2025-10-15T10:55:24.502Z [snapcraft] 2025-10-15T10:55:24.629Z [snapcraft] Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] 2025-10-15T10:55:24.784Z [snapcraft] Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB] 2025-10-15T10:55:24.867Z [snapcraft] Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [71.0 kB] 2025-10-15T10:55:24.923Z [snapcraft] Get:4 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1276 kB] 2025-10-15T10:55:25.142Z [snapcraft] Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [3429 kB] 2025-10-15T10:55:25.522Z [pebble] GET /v1/changes/1/wait 1.040631314s 200 (http+unix) 2025-10-15T10:55:25.523Z [pebble] Started default services with change 1. 2025-10-15T10:55:25.568Z [snapcraft] Get:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] 2025-10-15T10:55:25.679Z [snapcraft] Get:7 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [5742 kB] 2025-10-15T10:55:25.818Z [snapcraft] Get:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB] 2025-10-15T10:55:26.079Z [snapcraft] Get:9 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB] 2025-10-15T10:55:28.786Z [snapcraft] Get:10 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB] 2025-10-15T10:55:28.802Z [snapcraft] Get:11 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB] 2025-10-15T10:55:29.032Z [snapcraft] Get:12 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB] 2025-10-15T10:55:29.106Z [snapcraft] Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [5936 kB] 2025-10-15T10:55:29.843Z [snapcraft] Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1584 kB] 2025-10-15T10:55:30.031Z [snapcraft] Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [69.1 kB] 2025-10-15T10:55:30.038Z [snapcraft] Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [3755 kB] 2025-10-15T10:55:30.486Z [snapcraft] Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [35.2 kB] 2025-10-15T10:55:30.491Z [snapcraft] Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [83.9 kB] 2025-10-15T10:55:30.629Z [snapcraft] Fetched 42.3 MB in 6s (6935 kB/s) 2025-10-15T10:55:30.629Z [snapcraft] Reading package lists... 2025-10-15T10:55:31.561Z [snapcraft] Building dependency tree... 2025-10-15T10:55:31.787Z [snapcraft] Reading state information... 2025-10-15T10:55:31.822Z [snapcraft] 8 packages can be upgraded. Run 'apt list --upgradable' to see them. 2025-10-15T10:55:33.903Z [snapcraft] Initializing parts lifecycle 2025-10-15T10:55:33.915Z [snapcraft] Installing build-packages 2025-10-15T10:55:52.429Z [snapcraft] The following snaps are required but not installed as the application is running inside docker or podman container: gnome-42-2204, astral-uv, core22. 2025-10-15T10:55:52.429Z [snapcraft] Please ensure the environment is properly setup before continuing. 2025-10-15T10:55:52.429Z [snapcraft] Ignore this message if the appropriate measures have already been taken. 2025-10-15T10:55:52.433Z [snapcraft] Environment validation failed for part 'flash-station': 'uv' not found and part 'flash-station' does not depend on a part named 'uv-deps' that would satisfy the dependency. 2025-10-15T10:55:52.435Z [snapcraft] Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20251015-105533.862823.log' 2025-10-15T10:55:52.657Z [pebble] Service "snapcraft" stopped unexpectedly with code 1 2025-10-15T10:55:52.657Z [pebble] Service "snapcraft" on-failure action is "shutdown", triggering failure shutdown 2025-10-15T10:55:52.657Z [pebble] Server exiting! Reason: <nil> 2025-10-15T10:55:52.657Z [pebble] {"type":"security","datetime":"2025-10-15T10:55:52Z","level":"WARN","event":"sys_shutdown:0","description":"Shutting down daemon","appid":"pebble"} ``` So I tried to create a Dockerfile ``` FROM ghcr.io/canonical/snapcraft:8_core22 RUN snap install astral-uv core22 gnome-42-2204 ``` But all I get then is ``` [+] Building 0.6s (5/5) FINISHED docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 128B 0.0s => [internal] load metadata for ghcr.io/canonical/snapcraft:8_core22 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => CACHED [1/2] FROM ghcr.io/canonical/snapcraft:8_core22 0.0s => ERROR [2/2] RUN snap install astral-uv core22 gnome-42-2204 0.4s ------ > [2/2] RUN snap install astral-uv core22 gnome-42-2204: 0.324 error: cannot communicate with server: Post "http://localhost/v2/snaps": dial unix /run/snapd.socket: connect: no such file or directory ------ Dockerfile:3 -------------------- 1 | FROM ghcr.io/canonical/snapcraft:8_core22 2 | 3 | >>> RUN snap install astral-uv core22 gnome-42-2204 4 | -------------------- ERROR: failed to build: failed to solve: process "/bin/sh -c snap install astral-uv core22 gnome-42-2204" did not complete successfully: exit code: 1 ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Docker images lack a running snapd; build-snaps must be downloaded and extracted into /snap manually. The residual Snapcraft warning is harmless when builds succeed.
stealth/space-bunny-alpha — closed not a bug Docker lacks snapd for normal snap installation; manually downloading and extracting build-snaps works. The remaining container warning is harmless when builds succeed.
qwen/qwen3.6-35b-a3b — — Closed as resolved. Docker lacks snapd, preventing standard snap installation. A workaround manually downloads and extracts build-snaps. The warning is harmless if the build succeeds. No code changes required.
qwen/qwen3.6-35b-a3b — — Resolved via community workaround. Build-snaps cannot be installed via snapd in Docker; they must be manually downloaded and extracted. The warning about missing snaps is harmless and does not block builds. Issue closed as resolved.
qwen/qwen3.6-35b-a3b — — Resolved via workaround. Snapd is unavailable in Docker, blocking standard build-snap installation. Users must manually download and extract snaps with curl and unsquashfs. The warning is harmless and does not block builds.
qwen3.6-35b-a3b-mtp-q6 — — Resolved via community workaround. Standard Docker lacks snapd, so build-snaps require manual extraction using curl, jq, and unsquashfs. The persistent warning is harmless and does not block builds. Issue closed as answered.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.