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

Update Docker image instructions #3499

Merged
merged 4 commits into from
Apr 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 9 additions & 20 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
# Creating docker containers for snapcraft

## Setup
By default the `Dockerfile` builds Ubuntu 16.04 (Xenial) image with `snapcraft` from the `edge` channel.

sudo snap install docker
docker build . --no-cache

Ensure networking works, in some cases `dockerd` might need to have something
like `--dns=8.8.8.8` added to the command.
It is however possible to choose the base Ubuntu version and the Snapcraft channel (risk levels):

## Creating containers
- `edge`
- `beta`
- `candidate`
- `stable`

The Dockerfile here can build images for these risk levels:
To do that, use `--build-arg RISK=<risk>` and `--build-arg UBUNTU=<name>` arguments:

- **edge**: Using the snap from edge
- **beta**: Using the snap from beta
- **candidate**: Using the snap from candidate
- **stable**: Using the snap from stable

By default, the `edge` image will be built. Pass `--build-arg RISK=<risk>` to
choose needed risk level for target container:

export RISK=beta
docker build --no-cache --tag snapcore/snapcraft:$RISK --build-arg RISK=$RISK .

You can push that image with:

docker push snapcore/snapcraft:$RISK
docker build . --no-cache --build-arg RISK=beta --build-arg UBUNTU=bionic