Skip to content

Commit

Permalink
docker: parametrize Ubuntu version
Browse files Browse the repository at this point in the history
To avoid changing Dockerfile as described in
https://forum.snapcraft.io/t/creating-docker-images-for-snapcraft/11739

Signed-off-by: Anatoli Babenia <anatoli@rainforce.org>
  • Loading branch information
abitrolly committed Jan 2, 2020
1 parent a6c0f5a commit 26bd7de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docker/Dockerfile
@@ -1,8 +1,9 @@
ARG RISK=edge
ARG UBUNTU=xenial

FROM ubuntu:xenial as builder
FROM ubuntu:$UBUNTU as builder

RUN echo "Building snapcraft:$RISK"
RUN echo "Building snapcraft:$RISK in ubuntu:$UBUNTU"

# Grab dependencies
RUN apt-get update
Expand Down Expand Up @@ -31,7 +32,7 @@ RUN chmod +x /snap/bin/snapcraft

# Multi-stage build, only need the snaps from the builder. Copy them one at a
# time so they can be cached.
FROM ubuntu:xenial
FROM ubuntu:$UBUNTU
COPY --from=builder /snap/core /snap/core
COPY --from=builder /snap/snapcraft /snap/snapcraft
COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
Expand Down

0 comments on commit 26bd7de

Please sign in to comment.