Skip to content

Commit

Permalink
docker: update instructions (#3499)
Browse files Browse the repository at this point in the history
Leave only relevant details and mention how to specify Ubuntu version

Co-authored-by: Chris Patterson <cjp256@gmail.com>
  • Loading branch information
abitrolly and cjp256 committed Apr 16, 2021
1 parent 6cdbf27 commit 226da60
Showing 1 changed file with 9 additions and 20 deletions.
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

0 comments on commit 226da60

Please sign in to comment.