build: Simplify build image for snaps

This commit is contained in:
Jakob Borg 2020-02-23 08:40:42 +01:00
parent 40e1835927
commit 7b8622c2e9

View File

@ -1,26 +1,17 @@
# It's difficult to install snapcraft (the packaging tool) on a non-snap # We will grab the Go compiler from the latest Go image.
# distribution such as Debian without running snapd (which doesn't work under FROM golang as go
# Docker). We cheat by taking their Docker image and snarfing the resulting
# binaries.
FROM snapcore/snapcraft AS snapcraft
# Otherwise we base on the Go image, which is Debian based. # Otherwise we base on the snapcraft container as that is by far the
FROM golang # most complex and tricky thing to get installed and working...
FROM snapcore/snapcraft
# The snap stuff, as mentioned, with variables set to let the snapcraft snap play ball # Go
COPY --from=snapcraft /snap /snap COPY --from=go /usr/local/go /usr/local/go
ENV LANG="en_US.UTF-8" ENV PATH="/usr/local/go/bin:$PATH"
ENV LANGUAGE="en_US:en"
ENV LC_ALL="en_US.UTF-8"
ENV SNAP="/snap/snapcraft/current"
ENV SNAP_NAME="snapcraft"
ENV SNAP_ARCH="amd64"
ENV PATH="$PATH:/snap/bin"
# FPM to build Debian packages # FPM to build Debian packages
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
locales rubygems ruby-dev \ locales rubygems ruby-dev build-essential git \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& gem install --no-ri --no-rdoc fpm \ && gem install --no-ri --no-rdoc fpm
&& locale-gen en_US.UTF-8