-
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.
docker: add Dockerfiles for all risk levels (#1914)
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
- Loading branch information
Kyle Fazzari
committed
Feb 12, 2018
1 parent
6bd4c9e
commit 512c544
Showing
7 changed files
with
74 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Creating docker containers for snapcraft | ||
|
||
## Setup | ||
|
||
sudo snap install docker | ||
|
||
Ensure networking works, in some cases `dockerd` might need to have something | ||
like `--dns=8.8.8.8` added to the command. | ||
|
||
## Creating containers | ||
|
||
There are four separate Dockerfiles here, each one corresponding to their | ||
respective risk level: | ||
|
||
- **edge.Dockerfile**: Using the snap from edge | ||
- **beta.Dockerfile**: Using the snap from beta | ||
- **candidate.Dockerfile**: Using the snap from candidate | ||
- **stable.Dockerfile**: Using the snap from stable | ||
|
||
Build the docker image with the following (note that `--network host` is not | ||
strictly needed if a proper docker bridge is setup): | ||
|
||
docker build --no-cache -f <risk>.Dockerfile --label snapcore/snapcraft --tag snapcore/snapcraft:<risk> --network host . | ||
|
||
You can push that image with: | ||
|
||
docker push snapcore/snapcraft:<risk> |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
export SNAP_VERSION="$(awk '/^version:/{print $2}' '/snap/snapcraft/current/meta/snap.yaml')" | ||
exec $SNAP/usr/bin/python3 $SNAP/bin/snapcraft "$@" |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:xenial | ||
|
||
RUN apt-get update && \ | ||
apt-get dist-upgrade --yes && \ | ||
apt-get install --yes \ | ||
curl sudo jq squashfs-tools && \ | ||
curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap && \ | ||
mkdir -p /snap/core && unsquashfs -d /snap/core/current core.snap && rm core.snap && \ | ||
curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel=candidate' | jq '.download_url' -r) --output snapcraft.snap && \ | ||
mkdir -p /snap/snapcraft && unsquashfs -d /snap/snapcraft/current snapcraft.snap && rm snapcraft.snap && \ | ||
apt remove --yes --purge curl jq squashfs-tools && \ | ||
apt-get autoclean --yes && \ | ||
apt-get clean --yes | ||
|
||
COPY bin/snapcraft-wrapper /snap/bin/snapcraft | ||
|
||
|
||
ENV SNAP=/snap/snapcraft/current | ||
ENV SNAP_NAME=snapcraft | ||
ENV PATH=/snap/bin:$PATH |
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:xenial | ||
|
||
RUN apt-get update && \ | ||
apt-get dist-upgrade --yes && \ | ||
apt-get install --yes \ | ||
curl sudo jq squashfs-tools && \ | ||
curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap && \ | ||
mkdir -p /snap/core && unsquashfs -d /snap/core/current core.snap && rm core.snap && \ | ||
curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel=stable' | jq '.download_url' -r) --output snapcraft.snap && \ | ||
mkdir -p /snap/snapcraft && unsquashfs -d /snap/snapcraft/current snapcraft.snap && rm snapcraft.snap && \ | ||
apt remove --yes --purge curl jq squashfs-tools && \ | ||
apt-get autoclean --yes && \ | ||
apt-get clean --yes | ||
|
||
COPY bin/snapcraft-wrapper /snap/bin/snapcraft | ||
|
||
|
||
ENV SNAP=/snap/snapcraft/current | ||
ENV SNAP_NAME=snapcraft | ||
ENV PATH=/snap/bin:$PATH |