All failures in my second post are from podman
Building snaps without `snapd` I use podman for everything, because it runs containers without daemons, root access and creating those root owned files in my dir.
Iâve just realized how many hacks are used to get the core18
build using docker container.
-
snapcraft
in apt repository is outdated - 2.x - it is impossible to use that for core18 builds
-
snapcraft
from snap
uses core
from Ubuntu 16.04 and even if executed from Ubuntu 18.04, it can not access its files necessary for core18
- When I built the image
yakshaveinc/snapcraft:core18-edge
with Ubuntu 18.04 and native snapcraft
, then finally snapcraft
could access files necessary for core18
from the main system, but⌠it was not enough
Running container with native snapcraft
on Ubuntu 18.04 worked only in Docker:
â docker run -v $PWD:/src:Z -w /src yakshaveinc/snapcraft:core18-edge snapcraft
Locale not set! Snapcraft will temporarily use C.UTF-8
Using 'snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
The following snaps are required but not installed as snapcraft is running inside docker: core18.
Please ensure the environment is properly setup before continuing.
Ignore this message if the appropriate measures have already been taken
Pulling yakshaveinc
Building yakshaveinc
Staging yakshaveinc
Priming yakshaveinc
'confinement' property not specified: defaulting to 'strict'
'grade' property not specified: defaulting to 'stable'
Snapping 'yakshaveinc' ...
Snapped yakshaveinc_eternal_amd64.snap
But fails with another engine for running Docker containers:
â podman run -v $PWD:/src:Z -w /src yakshaveinc/snapcraft:core18-edge snapcraft
Locale not set! Snapcraft will temporarily use C.UTF-8
Using 'snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
You need 'multipass' set-up to build snaps: https://github.com/CanonicalLtd/multipass/releases.
even with explicit --destructive-mode
, but with different error
â podman run -v $PWD:/src:Z -w /src yakshaveinc/snapcraft:core18-edge snapcraft --destructive-mode
Locale not set! Snapcraft will temporarily use C.UTF-8
Using 'snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Failed to get information for snap 'core18': could not connect to 'http+unix://%2Frun%2Fsnapd.socket/v2/snaps/core18'.
And the reason for that is hack no.4
- Explicit check for running in Docker container - see
docker run
output above
The following snaps are required but not installed as snapcraft is running inside docker: core18.
Please ensure the environment is properly setup before continuing.
Ignore this message if the appropriate measures have already been taken
I tried to fix my core18
builds in TravisCI for over 3 months and this week weâve got a long holiday here, in Belarus and I could concentrate on cleaning my own technical debts. I am so happy that builds have started to work finally - https://travis-ci.org/yakshaveinc/linux/builds/528809947#L585 and I am even more happy to understand why. Thanks for guiding me, Mr.@ijohnson.
What can help to solve issue with podman
. Replacing Docker-specific check to some generic container check. More explicit debug output how snapcraft
chooses environment where the snap
is built and why. Explicit flag to run without wrappers. I thought that --destructive-mode
is that flag, but what I still donât understand - why running with snapcraft --destructive-mode
with podman
(for core18
, snapcraft
installed natively n Ubuntu 18.04) fails with the error of accessing snapd
?