Skip to content

Commit

Permalink
Docker: Upgrade Go to 1.15.3
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Mayer <[email protected]>
  • Loading branch information
lastzero committed Oct 20, 2020
1 parent 5f113d5 commit b5c7174
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM photoprism/development:20201004
FROM photoprism/development:20201020

# Set up project directory
WORKDIR "/go/src/github.com/photoprism/photoprism"
Expand Down
8 changes: 5 additions & 3 deletions docker/development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"; \
Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions docker/photoprism/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker/photoprism/arm64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"; \
Expand Down Expand Up @@ -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
Expand Down
21 changes: 0 additions & 21 deletions docker/photoprism/entrypoint.sh

This file was deleted.

0 comments on commit b5c7174

Please sign in to comment.