Docker: Reorganize image folders and update build scripts
This commit is contained in:
parent
0a696f8d49
commit
823f864896
9 changed files with 52 additions and 52 deletions
52
Makefile
52
Makefile
|
@ -202,43 +202,43 @@ clean:
|
|||
rm -rf storage/backup
|
||||
rm -rf storage/cache
|
||||
rm -rf frontend/node_modules
|
||||
docker-develop: docker-develop-impish docker-develop-buster docker-develop-bullseye
|
||||
docker-develop: docker-develop-impish docker-develop-bullseye docker-develop-buster docker-develop-armv7
|
||||
docker-develop-impish:
|
||||
docker pull --platform=amd64 ubuntu:21.10
|
||||
docker pull --platform=arm64 ubuntu:21.10
|
||||
scripts/docker/buildx-multi.sh develop linux/amd64,linux/arm64 $(DOCKER_TAG)
|
||||
docker-develop-buster:
|
||||
docker pull --platform=amd64 golang:buster
|
||||
docker pull --platform=arm64 golang:buster
|
||||
scripts/docker/buildx-multi.sh develop linux/amd64,linux/arm64 buster /buster
|
||||
docker pull --platform=amd64 ubuntu:impish
|
||||
docker pull --platform=arm64 ubuntu:impish
|
||||
scripts/docker/buildx-multi.sh develop linux/amd64,linux/arm64 $(DOCKER_TAG) /impish
|
||||
docker-develop-bullseye:
|
||||
docker pull --platform=amd64 golang:bullseye
|
||||
docker pull --platform=arm64 golang:bullseye
|
||||
scripts/docker/buildx-multi.sh develop linux/amd64,linux/arm64 bullseye /bullseye
|
||||
docker-preview: docker-preview-impish docker-preview-buster docker-preview-bullseye
|
||||
docker-preview-impish:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64
|
||||
docker-preview-buster:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 preview-buster /buster
|
||||
docker-preview-bullseye:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 preview-bullseye /bullseye
|
||||
docker-release: docker-release-impish docker-release-buster docker-release-bullseye
|
||||
docker-release-impish:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 $(DOCKER_TAG)
|
||||
docker-release-buster:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 buster /buster
|
||||
docker-release-bullseye:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 bullseye /bullseye
|
||||
docker-preview-arm64:
|
||||
scripts/docker/buildx.sh photoprism linux/arm64 preview-arm64 /bullseye
|
||||
docker-release-arm64:
|
||||
scripts/docker/buildx.sh photoprism linux/arm64 arm64 /bullseye
|
||||
docker-develop-buster:
|
||||
docker pull --platform=amd64 golang:buster
|
||||
docker pull --platform=arm64 golang:buster
|
||||
scripts/docker/buildx-multi.sh develop linux/amd64,linux/arm64 buster /buster
|
||||
docker-develop-armv7:
|
||||
docker pull --platform=arm golang:bullseye
|
||||
scripts/docker/buildx.sh develop linux/arm armv7 /armv7
|
||||
docker-preview: docker-preview-impish docker-preview-bullseye docker-preview-buster
|
||||
docker-preview-impish:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 preview /impish
|
||||
docker-preview-bullseye:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 preview-bullseye /bullseye
|
||||
docker-preview-buster:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 preview-buster /buster
|
||||
docker-preview-arm64:
|
||||
scripts/docker/buildx.sh photoprism linux/arm64 preview-arm64 /bullseye
|
||||
docker-preview-armv7:
|
||||
docker pull --platform=arm photoprism/develop:armv7
|
||||
scripts/docker/buildx.sh photoprism linux/arm preview-armv7 /armv7
|
||||
docker-release: docker-release-impish docker-release-bullseye docker-release-buster
|
||||
docker-release-impish:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 $(DOCKER_TAG) /impish
|
||||
docker-release-bullseye:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 bullseye /bullseye
|
||||
docker-release-buster:
|
||||
scripts/docker/buildx-multi.sh photoprism linux/amd64,linux/arm64 buster /buster
|
||||
docker-release-arm64:
|
||||
scripts/docker/buildx.sh photoprism linux/arm64 arm64 /bullseye
|
||||
docker-release-armv7:
|
||||
docker pull --platform=arm photoprism/develop:armv7
|
||||
scripts/docker/buildx.sh photoprism linux/arm armv7 /armv7
|
||||
|
|
|
@ -19,8 +19,8 @@ systems and devices, which saves our team a lot of time that we can then spend [
|
|||
providing support and developing one of the many features that users are waiting for.
|
||||
|
||||
Human-readable and versioned Dockerfiles as part of our public source code also help avoid "works for me" moments and
|
||||
other unwelcome surprises by enabling us to have the exact same environment everywhere in [development](develop/Dockerfile)
|
||||
and [production](photoprism/Dockerfile).
|
||||
other unwelcome surprises by enabling us to have the exact same environment everywhere in [development](develop/impish/Dockerfile)
|
||||
and [production](photoprism/impish/Dockerfile).
|
||||
|
||||
Last but not least, virtually all file format parsers have vulnerabilities that just haven't been discovered yet.
|
||||
This is a known risk that can affect you even if your computer is not directly connected to the Internet.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM ubuntu:21.10
|
||||
FROM ubuntu:impish
|
||||
|
||||
LABEL maintainer="Michael Mayer <hello@photoprism.app>"
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
##################################################### BUILD STAGE ######################################################
|
||||
FROM photoprism/develop:20220215-bullseye as build
|
||||
FROM photoprism/develop:20220216-bullseye as build
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETPLATFORM
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
##################################################### BUILD STAGE ######################################################
|
||||
FROM photoprism/develop:20220215-buster as build
|
||||
FROM photoprism/develop:20220216-buster as build
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETPLATFORM
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
##################################################### BUILD STAGE ######################################################
|
||||
FROM photoprism/develop:20220215 as build
|
||||
FROM photoprism/develop:20220216 as build
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETPLATFORM
|
||||
|
@ -9,13 +9,13 @@ ARG GODEBUG
|
|||
|
||||
# set up project directory
|
||||
WORKDIR "/go/src/github.com/photoprism/photoprism"
|
||||
COPY . .
|
||||
COPY .. .
|
||||
|
||||
# build frontend and backend
|
||||
RUN make npm dep build-js install
|
||||
|
||||
################################################## PRODUCTION STAGE ####################################################
|
||||
FROM ubuntu:21.10
|
||||
FROM ubuntu:impish
|
||||
|
||||
LABEL maintainer="Michael Mayer <hello@photoprism.app>"
|
||||
|
|
@ -14,8 +14,8 @@ NUMERIC='^[0-9]+$'
|
|||
GOPROXY=${GOPROXY:-'https://proxy.golang.org,direct'}
|
||||
DOCKER_TAG=$(date -u +%Y%m%d)
|
||||
|
||||
if [[ $1 ]] && [[ -z $2 ]]; then
|
||||
echo "docker/build: building photoprism/$1:preview...";
|
||||
if [[ $1 ]] && [[ -z $2 || $2 == "preview" ]]; then
|
||||
echo "docker/build: building photoprism/$1:preview from docker/${1/-//}$3/Dockerfile...";
|
||||
docker build \
|
||||
--no-cache \
|
||||
--pull \
|
||||
|
@ -23,9 +23,9 @@ if [[ $1 ]] && [[ -z $2 ]]; then
|
|||
--build-arg GOPROXY \
|
||||
--build-arg GODEBUG \
|
||||
-t photoprism/$1:preview \
|
||||
-f docker/${1/-//}/Dockerfile .
|
||||
-f docker/${1/-//}$3/Dockerfile .
|
||||
elif [[ $2 =~ $NUMERIC ]]; then
|
||||
echo "docker/build: building photoprism/$1:$2,$1:latest...";
|
||||
echo "docker/build: building photoprism/$1:$2,$1:latest from docker/${1/-//}$3/Dockerfile...";
|
||||
docker build \
|
||||
--no-cache \
|
||||
--pull \
|
||||
|
@ -34,7 +34,7 @@ elif [[ $2 =~ $NUMERIC ]]; then
|
|||
--build-arg GODEBUG \
|
||||
-t photoprism/$1:latest \
|
||||
-t photoprism/$1:$2 \
|
||||
-f docker/${1/-//}/Dockerfile .
|
||||
-f docker/${1/-//}$3/Dockerfile .
|
||||
elif [[ $2 == *"preview"* ]]; then
|
||||
echo "docker/build: building photoprism/$1:$2 from docker/${1/-//}$3/Dockerfile...";
|
||||
docker build $4\
|
||||
|
|
|
@ -12,18 +12,18 @@ NUMERIC='^[0-9]+$'
|
|||
GOPROXY=${GOPROXY:-'https://proxy.golang.org,direct'}
|
||||
DOCKER_TAG=$(date -u +%Y%m%d)
|
||||
|
||||
# Kill old multibuilder if still alive.
|
||||
# kill old multi builder if still alive.
|
||||
echo "docker/buildx-multi: removing existing multibuilder..."
|
||||
docker buildx rm multibuilder 2>/dev/null
|
||||
|
||||
# Wait 5 seconds.
|
||||
# wait 5 seconds.
|
||||
sleep 5
|
||||
|
||||
# Create new multibuilder.
|
||||
# create new multibuilder.
|
||||
docker buildx create --name multibuilder --use || { echo 'failed'; exit 1; }
|
||||
|
||||
if [[ $1 ]] && [[ $2 ]] && [[ -z $3 ]]; then
|
||||
echo "docker/buildx-multi: building photoprism/$1:preview..."
|
||||
if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then
|
||||
echo "docker/buildx-multi: building photoprism/$1:preview from docker/${1/-//}$4/Dockerfile..."
|
||||
docker buildx build \
|
||||
--platform $2 \
|
||||
--pull \
|
||||
|
@ -31,11 +31,11 @@ if [[ $1 ]] && [[ $2 ]] && [[ -z $3 ]]; then
|
|||
--build-arg BUILD_TAG=$DOCKER_TAG \
|
||||
--build-arg GOPROXY \
|
||||
--build-arg GODEBUG \
|
||||
-f docker/${1/-//}/Dockerfile \
|
||||
-f docker/${1/-//}$4/Dockerfile \
|
||||
-t photoprism/$1:preview \
|
||||
--push .
|
||||
elif [[ $3 =~ $NUMERIC ]]; then
|
||||
echo "docker/buildx-multi: building photoprism/$1:$3,$1:latest..."
|
||||
echo "docker/buildx-multi: building photoprism/$1:$3,$1:latest from docker/${1/-//}$4/Dockerfile..."
|
||||
docker buildx build \
|
||||
--platform $2 \
|
||||
--pull \
|
||||
|
@ -43,7 +43,7 @@ elif [[ $3 =~ $NUMERIC ]]; then
|
|||
--build-arg BUILD_TAG=$3 \
|
||||
--build-arg GOPROXY \
|
||||
--build-arg GODEBUG \
|
||||
-f docker/${1/-//}/Dockerfile \
|
||||
-f docker/${1/-//}$4/Dockerfile \
|
||||
-t photoprism/$1:latest \
|
||||
-t photoprism/$1:$3 \
|
||||
--push .
|
||||
|
|
|
@ -12,8 +12,8 @@ NUMERIC='^[0-9]+$'
|
|||
GOPROXY=${GOPROXY:-'https://proxy.golang.org,direct'}
|
||||
DOCKER_TAG=$(date -u +%Y%m%d)
|
||||
|
||||
if [[ $1 ]] && [[ $2 ]] && [[ -z $3 ]]; then
|
||||
echo "docker/buildx: building photoprism/$1:preview..."
|
||||
if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then
|
||||
echo "docker/buildx: building photoprism/$1:preview from docker/${1/-//}$4/Dockerfile..."
|
||||
docker buildx build \
|
||||
--platform $2 \
|
||||
--pull \
|
||||
|
@ -21,11 +21,11 @@ if [[ $1 ]] && [[ $2 ]] && [[ -z $3 ]]; then
|
|||
--build-arg BUILD_TAG=$DOCKER_TAG \
|
||||
--build-arg GOPROXY \
|
||||
--build-arg GODEBUG \
|
||||
-f docker/${1/-//}/Dockerfile \
|
||||
-f docker/${1/-//}$4/Dockerfile \
|
||||
-t photoprism/$1:preview \
|
||||
--push .
|
||||
elif [[ $3 =~ $NUMERIC ]]; then
|
||||
echo "docker/buildx: building photoprism/$1:$3,$1:latest..."
|
||||
echo "docker/buildx: building photoprism/$1:$3,$1:latest from docker/${1/-//}$4/Dockerfile..."
|
||||
docker buildx build \
|
||||
--platform $2 \
|
||||
--pull \
|
||||
|
@ -33,7 +33,7 @@ elif [[ $3 =~ $NUMERIC ]]; then
|
|||
--build-arg BUILD_TAG=$3 \
|
||||
--build-arg GOPROXY \
|
||||
--build-arg GODEBUG \
|
||||
-f docker/${1/-//}/Dockerfile \
|
||||
-f docker/${1/-//}$4/Dockerfile \
|
||||
-t photoprism/$1:latest \
|
||||
-t photoprism/$1:$3 \
|
||||
--push .
|
||||
|
|
Loading…
Reference in a new issue