Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: there is now the official repo with images #5063

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 the
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
```
Loading