mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 22:29:07 +00:00
Use alpine as base images. (#1033)
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
Types: deb
|
||||
# http://snapshot.debian.org/archive/debian/20240722T000000Z
|
||||
URIs: http://deb.debian.org/debian
|
||||
Suites: testing testing-updates
|
||||
Components: main
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
Types: deb
|
||||
# http://snapshot.debian.org/archive/debian-security/20240722T000000Z
|
||||
URIs: http://deb.debian.org/debian-security
|
||||
Suites: testing-security
|
||||
Components: main
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
@@ -1,11 +0,0 @@
|
||||
Package: *
|
||||
Pin: release n=bookworm
|
||||
Pin-Priority: 700
|
||||
|
||||
Package: *
|
||||
Pin: release n=bookworm-updates
|
||||
Pin-Priority: 700
|
||||
|
||||
Package: *
|
||||
Pin: release n=bookworm-security
|
||||
Pin-Priority: 700
|
||||
@@ -1,42 +1,11 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$TARGETPLATFORM" == "linux/arm64" ]; then
|
||||
dpkg --add-architecture arm64
|
||||
DEBIAN_ARCH='arm64'
|
||||
elif [ "$TARGETPLATFORM" == "linux/arm/v6" ] || [ "$TARGETPLATFORM" == "linux/arm/v7" ]; then
|
||||
dpkg --add-architecture armhf
|
||||
DEBIAN_ARCH='armhf'
|
||||
else
|
||||
dpkg --add-architecture amd64
|
||||
DEBIAN_ARCH='amd64'
|
||||
fi
|
||||
apk update
|
||||
|
||||
apt-get update
|
||||
|
||||
# Install G++/GCC cross compilers
|
||||
if [ "$DEBIAN_ARCH" == "arm64" ]; then
|
||||
apt-get install -y \
|
||||
g++-aarch64-linux-gnu \
|
||||
libc6-dev-arm64-cross
|
||||
elif [ "$DEBIAN_ARCH" == "armhf" ]; then
|
||||
apt-get install -y \
|
||||
g++-arm-linux-gnueabihf \
|
||||
libc6-dev-armhf-cross
|
||||
else
|
||||
apt-get install -y \
|
||||
g++-x86-64-linux-gnu \
|
||||
libc6-dev-amd64-cross
|
||||
fi
|
||||
|
||||
# Install go-face dependencies and libheif for HEIF media decoding
|
||||
apt-get install -y \
|
||||
libdlib-dev:${DEBIAN_ARCH} \
|
||||
libblas-dev:${DEBIAN_ARCH} \
|
||||
libatlas-base-dev:${DEBIAN_ARCH} \
|
||||
liblapack-dev:${DEBIAN_ARCH} \
|
||||
libjpeg-dev:${DEBIAN_ARCH} \
|
||||
libheif-dev:${DEBIAN_ARCH}
|
||||
apk add go g++ blas-dev cblas lapack-dev jpeg-dev libheif-dev
|
||||
apk add dlib-dev --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||
|
||||
# Install tools for development
|
||||
apt-get install -y reflex sqlite3
|
||||
apk add sqlite
|
||||
go install github.com/cespare/reflex@latest
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -euo pipefail
|
||||
|
||||
apt-get update
|
||||
apt-get install -y curl libdlib19.2 ffmpeg exiftool libheif1 imagemagick
|
||||
apk update
|
||||
|
||||
# Remove build dependencies and cleanup
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
apk add curl libheif lapack cblas exiftool
|
||||
apk add ffmpeg ffmpeg-libs ffmpeg-libavcodec ffmpeg-libavformat
|
||||
apk add imagemagick imagemagick-libs imagemagick-heic imagemagick-jpeg imagemagick-raw imagemagick-tiff imagemagick-webp imagemagick-svg imagemagick-jxl
|
||||
apk add dlib --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Script to configure environment variables for Go compiler
|
||||
# to allow cross compilation
|
||||
|
||||
: ${TARGETPLATFORM=}
|
||||
: ${TARGETOS=}
|
||||
: ${TARGETARCH=}
|
||||
: ${TARGETVARIANT=}
|
||||
|
||||
CGO_ENABLED="$(go env CGO_ENABLED)"
|
||||
GOARCH="$(go env GOARCH)"
|
||||
GOOS="$(go env GOOS)"
|
||||
GOARM="$(go env GOARM)"
|
||||
GOBIN="$(go env GOBIN)"
|
||||
|
||||
set -eu
|
||||
|
||||
if [ ! -z "$TARGETPLATFORM" ]; then
|
||||
TARGETOS="$(echo $TARGETPLATFORM | cut -d"/" -f1)"
|
||||
TARGETARCH="$(echo $TARGETPLATFORM | cut -d"/" -f2)"
|
||||
TARGETVARIANT="$(echo $TARGETPLATFORM | cut -d"/" -f3)"
|
||||
fi
|
||||
|
||||
if [ ! -z "$TARGETOS" ]; then
|
||||
export GOOS="$TARGETOS"
|
||||
fi
|
||||
|
||||
if [ ! -z "$TARGETARCH" ]; then
|
||||
export GOARCH="$TARGETARCH"
|
||||
fi
|
||||
|
||||
if [ "$TARGETARCH" = "arm" ]; then
|
||||
if [ ! -z "$TARGETVARIANT" ]; then
|
||||
case "$TARGETVARIANT" in
|
||||
"v5")
|
||||
export GOARM="5"
|
||||
;;
|
||||
"v6")
|
||||
export GOARM="6"
|
||||
;;
|
||||
*)
|
||||
export GOARM="7"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
export GOARM="7"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CGO_ENABLED" = "1" ]; then
|
||||
case "$GOARCH" in
|
||||
"amd64")
|
||||
export COMPILER_ARCH="x86_64-linux-gnu"
|
||||
;;
|
||||
"ppc64le")
|
||||
export COMPILER_ARCH="powerpc64le-linux-gnu"
|
||||
;;
|
||||
"s390x")
|
||||
export COMPILER_ARCH="s390x-linux-gnu"
|
||||
;;
|
||||
"arm64")
|
||||
export COMPILER_ARCH="aarch64-linux-gnu"
|
||||
;;
|
||||
"arm")
|
||||
case "$GOARM" in
|
||||
"5")
|
||||
export COMPILER_ARCH="arm-linux-gnueabi"
|
||||
;;
|
||||
*)
|
||||
export COMPILER_ARCH="arm-linux-gnueabihf"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
export CC="${COMPILER_ARCH}-gcc"
|
||||
export CXX="${COMPILER_ARCH}-g++"
|
||||
export PKG_CONFIG_PATH="/usr/lib/${COMPILER_ARCH}/pkgconfig/"
|
||||
|
||||
if [ -z "$GOBIN" ] && [ -n "$GOPATH" ] && [ -n "$GOARCH" ] && [ -n "$GOOS" ]; then
|
||||
export PATH=${GOPATH}/bin/${GOOS}_${GOARCH}:${PATH}
|
||||
fi
|
||||
Reference in New Issue
Block a user