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:
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
|
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
|
||||||
|
|
||||||
ARG UID=1000
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ENV ANDROID_HOME="/opt/android"
|
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.
|
# create new user to avoid using root; but with sudo access and no password for convenience.
|
||||||
|
ARG UID=1000
|
||||||
ENV USER="user"
|
ENV USER="user"
|
||||||
ENV HOME_DIR="/home/${USER}"
|
ENV HOME_DIR="/home/${USER}"
|
||||||
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
||||||
|
|||||||
@@ -37,10 +37,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
|
|||||||
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
||||||
fi
|
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."
|
info "building docker image."
|
||||||
docker build \
|
docker build \
|
||||||
$DOCKER_BUILD_FLAGS \
|
$DOCKER_BUILD_FLAGS \
|
||||||
--build-arg UID=$BUILD_UID \
|
|
||||||
-t electrum-android-builder-img \
|
-t electrum-android-builder-img \
|
||||||
--file "$CONTRIB_ANDROID/Dockerfile" \
|
--file "$CONTRIB_ANDROID/Dockerfile" \
|
||||||
"$PROJECT_ROOT"
|
"$PROJECT_ROOT"
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
FROM debian:buster@sha256:233c3bbc892229c82da7231980d50adceba4db56a08c0b7053a4852782703459
|
FROM debian:buster@sha256:233c3bbc892229c82da7231980d50adceba4db56a08c0b7053a4852782703459
|
||||||
|
|
||||||
ARG UID=1000
|
|
||||||
|
|
||||||
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
|
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
@@ -73,6 +71,7 @@ RUN apt-get update -q && \
|
|||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
# create new user to avoid using root; but with sudo access and no password for convenience.
|
# create new user to avoid using root; but with sudo access and no password for convenience.
|
||||||
|
ARG UID=1000
|
||||||
ENV USER="user"
|
ENV USER="user"
|
||||||
ENV HOME_DIR="/home/${USER}"
|
ENV HOME_DIR="/home/${USER}"
|
||||||
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
||||||
|
|||||||
@@ -22,10 +22,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
|
|||||||
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
||||||
fi
|
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."
|
info "building docker image."
|
||||||
docker build \
|
docker build \
|
||||||
$DOCKER_BUILD_FLAGS \
|
$DOCKER_BUILD_FLAGS \
|
||||||
--build-arg UID=$BUILD_UID \
|
|
||||||
-t electrum-appimage-builder-img \
|
-t electrum-appimage-builder-img \
|
||||||
"$CONTRIB_APPIMAGE"
|
"$CONTRIB_APPIMAGE"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
|
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
|
||||||
|
|
||||||
ARG UID=1000
|
|
||||||
|
|
||||||
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
|
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
@@ -20,6 +18,7 @@ RUN apt-get update -q && \
|
|||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
# create new user to avoid using root; but with sudo access and no password for convenience.
|
# create new user to avoid using root; but with sudo access and no password for convenience.
|
||||||
|
ARG UID=1000
|
||||||
ENV USER="user"
|
ENV USER="user"
|
||||||
ENV HOME_DIR="/home/${USER}"
|
ENV HOME_DIR="/home/${USER}"
|
||||||
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
||||||
|
|||||||
@@ -22,10 +22,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
|
|||||||
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
||||||
fi
|
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."
|
info "building docker image."
|
||||||
docker build \
|
docker build \
|
||||||
$DOCKER_BUILD_FLAGS \
|
$DOCKER_BUILD_FLAGS \
|
||||||
--build-arg UID=$BUILD_UID \
|
|
||||||
-t electrum-sdist-builder-img \
|
-t electrum-sdist-builder-img \
|
||||||
"$CONTRIB_SDIST"
|
"$CONTRIB_SDIST"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
|
FROM debian:bullseye@sha256:43ef0c6c3585d5b406caa7a0f232ff5a19c1402aeb415f68bcd1cf9d10180af8
|
||||||
|
|
||||||
ARG UID=1000
|
|
||||||
|
|
||||||
# need ca-certificates before using snapshot packages
|
# need ca-certificates before using snapshot packages
|
||||||
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \
|
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \
|
||||||
ca-certificates
|
ca-certificates
|
||||||
@@ -61,6 +59,7 @@ RUN wget -nc https://dl.winehq.org/wine-builds/Release.key && \
|
|||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
# create new user to avoid using root; but with sudo access and no password for convenience.
|
# create new user to avoid using root; but with sudo access and no password for convenience.
|
||||||
|
ARG UID=1000
|
||||||
ENV USER="user"
|
ENV USER="user"
|
||||||
ENV HOME_DIR="/home/${USER}"
|
ENV HOME_DIR="/home/${USER}"
|
||||||
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
ENV WORK_DIR="${HOME_DIR}/wspace" \
|
||||||
|
|||||||
@@ -24,10 +24,13 @@ if [ ! -z "$ELECBUILD_NOCACHE" ] ; then
|
|||||||
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
DOCKER_BUILD_FLAGS="--pull --no-cache"
|
||||||
fi
|
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."
|
info "building docker image."
|
||||||
docker build \
|
docker build \
|
||||||
$DOCKER_BUILD_FLAGS \
|
$DOCKER_BUILD_FLAGS \
|
||||||
--build-arg UID=$BUILD_UID \
|
|
||||||
-t electrum-wine-builder-img \
|
-t electrum-wine-builder-img \
|
||||||
"$CONTRIB_WINE"
|
"$CONTRIB_WINE"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user