Skip to content

Commit

Permalink
chore!: remove Dockerfile and document snapcraft-rocks registry (#5063)
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoli Babenia <[email protected]>
  • Loading branch information
abitrolly authored Oct 7, 2024
1 parent 0633e5a commit 24e70d6
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 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
```

0 comments on commit 24e70d6

Please sign in to comment.