Docker: Upgrade Go to 1.15.3

Signed-off-by: Michael Mayer <michael@lastzero.net>
This commit is contained in:
Michael Mayer 2020-10-20 12:47:04 +02:00
parent 5f113d5f18
commit b5c71742d8
6 changed files with 32 additions and 30 deletions

View file

@ -1,4 +1,4 @@
FROM photoprism/development:20201004
FROM photoprism/development:20201020
# Set up project directory
WORKDIR "/go/src/github.com/photoprism/photoprism"

View file

@ -58,7 +58,8 @@ RUN apt-get update && apt-get upgrade && \
seccomp \
libseccomp-dev \
libseccomp2 \
fonts-roboto
fonts-roboto \
sudo
# Install Chromium Browser via .deb
RUN add-apt-repository -y ppa:xalt7x/chromium-deb-vaapi
@ -101,12 +102,12 @@ RUN npm install --unsafe-perm=true --allow-root -g npm testcafe chromedriver
RUN npm config set cache ~/.cache/npm
# Install Go
ENV GOLANG_VERSION 1.15.2
ENV GOLANG_VERSION 1.15.3
RUN set -eux; \
\
url="https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz"; \
wget -O go.tgz "$url"; \
echo "b49fda1ca29a1946d6bb2a5a6982cf07ccd2aba849289508ee0f9918f6bb4552 *go.tgz" | sha256sum -c -; \
echo "010a88df924a81ec21b293b5da8f9b11c176d27c0ee3962dc1738d2352d3c02d *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
export PATH="/usr/local/go/bin:$PATH"; \
@ -138,6 +139,7 @@ RUN env GO111MODULE=off /usr/local/go/bin/go get -u github.com/psampaz/go-mod-ou
RUN useradd photoprism -m -d /photoprism && \
chmod 777 /photoprism && \
echo "alias go=richgo" > /photoprism/.bash_aliases && \
echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chown -R photoprism:photoprism /photoprism && \
find /go -type d -print0 | xargs -0 chmod 777 && \
find /go -type f -print0 | xargs -0 chmod a+rw

21
docker/entrypoint.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
if [[ ${UMASK} ]]; then
umask "${UMASK}"
fi
if [[ ${UID} ]] && [[ ${GID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
groupadd -f -g "${GID}" "${GID}"
usermod -o -u "${UID}" -g "${GID}" photoprism
gosu "${UID}:${GID}" "$@" &
elif [[ ${UID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
usermod -o -u "${UID}" photoprism
gosu "${UID}" "$@" &
else
"$@" &
fi
PID=$!
trap "kill $PID" INT TERM
wait

View file

@ -1,4 +1,4 @@
FROM photoprism/development:20201004 as build
FROM photoprism/development:20201020 as build
# Set up project directory
WORKDIR "/go/src/github.com/photoprism/photoprism"
@ -117,7 +117,7 @@ RUN photoprism -v
EXPOSE 2342
# Configure entrypoint
COPY --chown=root:root /docker/photoprism/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# Run server

View file

@ -73,12 +73,12 @@ RUN npm install --unsafe-perm=true --allow-root -g npm
RUN npm config set cache ~/.cache/npm
# Install Go
ENV GOLANG_VERSION 1.15.2
ENV GOLANG_VERSION 1.15.3
RUN set -eux; \
\
url="https://golang.org/dl/go${GOLANG_VERSION}.linux-arm64.tar.gz"; \
wget -O go.tgz "$url"; \
echo "c8ec460cc82d61604b048f9439c06bd591722efce5cd48f49e19b5f6226bd36d *go.tgz" | sha256sum -c -; \
echo "b8b88a87ada918ef5189fa5938ef4c46a4f61952a34317612aaac705f4275f80 *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
export PATH="/usr/local/go/bin:$PATH"; \
@ -208,7 +208,7 @@ RUN photoprism -v
EXPOSE 2342
# Configure entrypoint
COPY --chown=root:root /docker/photoprism/entrypoint.sh /entrypoint.sh
COPY --chown=root:root /docker/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# Run server

View file

@ -1,21 +0,0 @@
#!/usr/bin/env bash
if [[ ${UMASK} ]]; then
umask ${UMASK}
fi
if [[ ${UID} ]] && [[ ${GID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
groupadd -f -g ${GID} ${GID}
usermod -o -u ${UID} -g ${GID} photoprism
gosu ${UID}:${GID} "$@" &
elif [[ ${UID} ]] && [[ ${UID} != "0" ]] && [[ $(id -u) = "0" ]]; then
usermod -o -u ${UID} photoprism
gosu ${UID} "$@" &
else
"$@" &
fi
PHOTOPRISM_PID=$!
trap "kill $PHOTOPRISM_PID" INT TERM
wait