lifecyle: avoid installation of snaps in docker
Metadata
Current evaluation
Merged PR #2457 (commit bacf47f7a): Snapcraft now detects Docker environments and warns users instead of attempting snap installation without snapd.
Resolution: closed resolved
Reason: PR #2457 was merged as commit bacf47f7a. The change prevents snap installation attempts in Docker and informs users that snapd is unavailable.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Docker environments are not capable of installing snaps given there is no
snapd running. Instead of trying to install, inform the user about the
situation for them to take the appropriate measures.
LP: #1814148
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2457 (commit bacf47f7a): Snapcraft now detects Docker environments and warns users instead of attempting snap installation without snapd. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #2457 (commit bacf47f7a) now detects Docker during lifecycle operations and reports that snaps cannot be installed instead of attempting installation. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #2457 (commit bacf47f7a): lifecycle code now detects Docker's lack of snapd and informs users instead of attempting snap installation. | |
| qwen/qwen3.6-35b-a3b | — | — | Successfully merged. The update prevents snap installation attempts in Docker by displaying a user message instead. Approved by a reviewer, passed coverage checks, and resolved the Docker compatibility issue. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Prevents snap installation attempts in Docker environments where snapd is unavailable, replacing them with a user notification. Resolves LP #1814148. Approved and merged into master. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1814148 suppress snap installation when on docker | snapcraft (launchpad) | closed | Snap installation in Docker was suppressed by detecting snapd-unavailable environments; linked PR snapcraft#2457 was merged as commit bacf47f7a. | |
| #3971 snap config: do not crash when config cannot be retrieved | snapcraft | merged | Merged PR #3971 as commit 1aec6c84b, preventing Snapcraft from crashing when snap config retrieval fails because snapd is unavailable in Docker. |