Skip to content

Commit

Permalink
docker: there is now the official repo with images
Browse files Browse the repository at this point in the history
https://github.com/canonical/snapcraft-rocks/

Signed-off-by: Anatoli Babenia <anatoli@rainforce.org>
  • Loading branch information
abitrolly committed Sep 25, 2024
1 parent 6c2e2a8 commit ee87b08
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 98 deletions.
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

74 changes: 0 additions & 74 deletions docker/Dockerfile

This file was deleted.

30 changes: 20 additions & 10 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
# Creating docker containers for snapcraft
# Docker images for `snapcraft`

By default the `Dockerfile` builds Ubuntu 16.04 (Xenial) image with `snapcraft` from the `edge` channel.
OCI-compliant container images and their sources are officially supported by
https://github.com/canonical/snapcraft-rocks/ project.

docker build . --no-cache
To build a snap with the docker container, you need to choose an image that
matches snap `base`. For example, to build `base: core24` snap:

It is however possible to choose the base Ubuntu version and the Snapcraft channel (risk levels):
docker run -it -v `pwd`:/project ghcr.io/canonical/snapcraft:8_core24

- `edge`
- `beta`
- `candidate`
- `stable`
* `8` in `8_core24` is the version of snapcraft.
* `\; -v` construction at the end is required to see `snapcraft` output.

To do that, use `--build-arg RISK=<risk>` and `--build-arg UBUNTU=<name>` arguments:
For more details, see official `snapcraft-rocks` repo from Canonical.

docker build . --no-cache --build-arg RISK=beta --build-arg UBUNTU=bionic
### Building snaps with `podman`

`podman` was born as a rootless alternative to Docker. It is default on Fedora
to have `podman` instead of Docker, but SELinux there doesn't allow containers
to write to volumes, so we just turn this "feature" off with
`--security-opt label=disable`.

```sh
podman run -it --rm --security-opt label=disable \
-v `pwd`:/project ghcr.io/canonical/snapcraft:8_core24 \; -v
```

0 comments on commit ee87b08

Please sign in to comment.