Unverified Commit 0e5d2948 authored by Sheogorath's avatar Sheogorath Committed by GitHub

Merge pull request #117 from codimd/gosu-distro

Switch to package repository for gosu
parents 07347aa3 689de077
......@@ -21,34 +21,6 @@ RUN apk add --no-cache --virtual .download \
rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
apk del .download
ENV GOSU_VERSION=1.11
COPY [ "resources/gosu-gpg.key", "/tmp/gosu.key" ]
RUN set -ex; \
\
apk add --no-cache --virtual .gosu-deps \
wget \
ca-certificates \
dpkg \
gnupg \
openssl \
; \
\
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
\
# verify the signature
export GNUPGHOME="$(mktemp -d)"; \
gpg --import /tmp/gosu.key; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
\
chmod +x /usr/local/bin/gosu; \
# verify that the binary works
gosu nobody true; \
\
apk del .gosu-deps
# Add configuraton files
COPY ["resources/config.json", "resources/.sequelizerc", "/files/"]
......@@ -60,6 +32,8 @@ RUN apk add --no-cache --virtual .dep \
jq \
openssl-dev \
python && \
apk add --no-cache --no-progress --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
gosu && \
# Clone the source
git clone --depth 1 --branch "$VERSION" "$CODIMD_REPOSITORY" /codimd && \
# Print the cloned version and clean up git files
......
......@@ -20,33 +20,10 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
ENV GOSU_VERSION 1.11
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY ["resources/gosu-gpg.key", "/tmp/gosu.key"]
RUN set -ex; \
apt-get update && \
apt-get install --no-install-recommends -qy \
gpg && \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
\
# verify the signature
export GNUPGHOME="$(mktemp -d)"; \
gpg --no-tty --import /tmp/gosu.key; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
\
chmod +x /usr/local/bin/gosu; \
# verify that the binary works
gosu nobody true && \
apt-get autoremove --purge -qy \
gpg && \
rm -r /var/lib/apt/lists/*
# Add configuraton files
COPY ["resources/config.json", "resources/.sequelizerc", "/files/"]
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN export dev_apt=( \
"bzip2" \
"git" \
......@@ -56,7 +33,8 @@ RUN export dev_apt=( \
apt-get install --no-install-recommends -y \
"${dev_apt[@]}" \
# Add fonts for PDF export
fonts-noto && \
fonts-noto \
gosu && \
\
# Clone the source
git clone --depth 1 --branch "$VERSION" "$CODIMD_REPOSITORY" /codimd && \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment