-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Leave only relevant details and mention how to specify Ubuntu version Co-authored-by: Chris Patterson <cjp256@gmail.com>
- Loading branch information
Showing
1 changed file
with
9 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |