1
0

build: follow-up prev: only use host userid for local dev builds

reproducibility probably needs a hardcoded userid

Also, move the UID arg later in the dockerfiles, for better caching.
(if local dev build and repro build set different UIDs, the build caches
will diverge at that step)
This commit is contained in:
SomberNight
2023-03-20 01:47:41 +00:00
parent ab073827cf
commit 6e472efd5f
8 changed files with 20 additions and 12 deletions

View File

@@ -2,8 +2,6 @@
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
ARG UID=1000
ENV DEBIAN_FRONTEND=noninteractive
ENV ANDROID_HOME="/opt/android"
@@ -143,6 +141,7 @@ RUN apt -y update -qq \
# create new user to avoid using root; but with sudo access and no password for convenience.
ARG UID=1000
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}/wspace" \

View File

@@ -37,10 +37,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
DOCKER_BUILD_FLAGS="--pull --no-cache"
fi
if [ -z "$ELECBUILD_COMMIT" ] ; then # local dev build
DOCKER_BUILD_FLAGS="$DOCKER_BUILD_FLAGS --build-arg UID=$BUILD_UID"
fi
info "building docker image."
docker build \
$DOCKER_BUILD_FLAGS \
--build-arg UID=$BUILD_UID \
-t electrum-android-builder-img \
--file "$CONTRIB_ANDROID/Dockerfile" \
"$PROJECT_ROOT"

View File

@@ -4,8 +4,6 @@
FROM debian:buster@sha256:233c3bbc892229c82da7231980d50adceba4db56a08c0b7053a4852782703459
ARG UID=1000
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
@@ -73,6 +71,7 @@ RUN apt-get update -q && \
apt-get clean
# create new user to avoid using root; but with sudo access and no password for convenience.
ARG UID=1000
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}/wspace" \

View File

@@ -22,10 +22,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
DOCKER_BUILD_FLAGS="--pull --no-cache"
fi
if [ -z "$ELECBUILD_COMMIT" ] ; then # local dev build
DOCKER_BUILD_FLAGS="$DOCKER_BUILD_FLAGS --build-arg UID=$BUILD_UID"
fi
info "building docker image."
docker build \
$DOCKER_BUILD_FLAGS \
--build-arg UID=$BUILD_UID \
-t electrum-appimage-builder-img \
"$CONTRIB_APPIMAGE"

View File

@@ -1,7 +1,5 @@
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
ARG UID=1000
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
@@ -20,6 +18,7 @@ RUN apt-get update -q && \
apt-get clean
# create new user to avoid using root; but with sudo access and no password for convenience.
ARG UID=1000
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}/wspace" \

View File

@@ -22,10 +22,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
DOCKER_BUILD_FLAGS="--pull --no-cache"
fi
if [ -z "$ELECBUILD_COMMIT" ] ; then # local dev build
DOCKER_BUILD_FLAGS="$DOCKER_BUILD_FLAGS --build-arg UID=$BUILD_UID"
fi
info "building docker image."
docker build \
$DOCKER_BUILD_FLAGS \
--build-arg UID=$BUILD_UID \
-t electrum-sdist-builder-img \
"$CONTRIB_SDIST"

View File

@@ -1,7 +1,5 @@
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
ARG UID=1000
# need ca-certificates before using snapshot packages
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \
ca-certificates
@@ -61,6 +59,7 @@ RUN wget -nc https://dl.winehq.org/wine-builds/Release.key && \
apt-get clean
# create new user to avoid using root; but with sudo access and no password for convenience.
ARG UID=1000
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}/wspace" \

View File

@@ -24,10 +24,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
DOCKER_BUILD_FLAGS="--pull --no-cache"
fi
if [ -z "$ELECBUILD_COMMIT" ] ; then # local dev build
DOCKER_BUILD_FLAGS="$DOCKER_BUILD_FLAGS --build-arg UID=$BUILD_UID"
fi
info "building docker image."
docker build \
$DOCKER_BUILD_FLAGS \
--build-arg UID=$BUILD_UID \
-t electrum-wine-builder-img \
"$CONTRIB_WINE"