armbian-oleg: introduce DOCKER_SIMULATE_CLEAN=yes so I can pretend to be Oleg, but using Docker

- if set, the Docker launcher will not install any dependencies
- so every Docker run will reinstall everything from scratch
- do NOT use, **even if you're Oleg**
This commit is contained in:
Ricardo Pardini 2023-01-09 23:50:53 +01:00
parent d7ea267389
commit 225e878743
No known key found for this signature in database
GPG Key ID: 3D38CA12A66C5D02

View File

@ -97,7 +97,7 @@ function docker_cli_prepare() {
# If we're NOT building the public, official image, then USE the public, official image as base.
# IMPORTANT: This has to match the naming scheme for tag the is used in the GitHub actions workflow.
if [[ "${DOCKERFILE_USE_ARMBIAN_IMAGE_AS_BASE}" != "no" ]]; then
if [[ "${DOCKERFILE_USE_ARMBIAN_IMAGE_AS_BASE}" != "no" && "${DOCKER_SIMULATE_CLEAN}" != "yes" ]]; then
# @TODO: this is rpardini's build. It's done in a different repo, so that's why the strange "armbian-release" name. It should be armbian/build:ubuntu-jammy-latest or something.
DOCKER_ARMBIAN_BASE_IMAGE="ghcr.io/rpardini/armbian-release:armbian-next-${wanted_os_tag}-${wanted_release_tag}-latest"
@ -209,23 +209,29 @@ function docker_cli_prepare() {
**/.DS_Store
DOCKERIGNORE
# This includes apt install equivalent to install_host_dependencies()
display_alert "Creating" "Dockerfile; FROM ${DOCKER_ARMBIAN_BASE_IMAGE}" "info"
declare c="" # Nothing; commands will run.
if [[ "${DOCKER_SIMULATE_CLEAN}" == "yes" ]]; then
display_alert "Simulating" "clean build, due to DOCKER_SIMULATE_CLEAN=yes -- this is wasteful and slow and only for debugging" "warn"
c="## " # Add comment to simulate clean env
fi
cat <<- INITIAL_DOCKERFILE > "${SRC}"/Dockerfile
FROM ${DOCKER_ARMBIAN_BASE_IMAGE}
# PLEASE DO NOT MODIFY THIS FILE. IT IS AUTOGENERATED AND WILL BE OVERWRITTEN. Please don't build this Dockerfile yourself either. Use Armbian helpers instead.
RUN echo "--> CACHE MISS IN DOCKERFILE: apt packages." && \
DEBIAN_FRONTEND=noninteractive apt-get -y update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ${BASIC_DEPS[@]} ${host_dependencies[@]}
RUN echo "--> CACHE MISS IN DOCKERFILE: pip3 packages." && \
pip3 install ${python3_pip_dependencies[@]}
RUN sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
RUN locale-gen
${c} # PLEASE DO NOT MODIFY THIS FILE. IT IS AUTOGENERATED AND WILL BE OVERWRITTEN. Please don't build this Dockerfile yourself either. Use Armbian helpers instead.
${c} RUN echo "--> CACHE MISS IN DOCKERFILE: apt packages." && \
${c} DEBIAN_FRONTEND=noninteractive apt-get -y update && \
${c} DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ${BASIC_DEPS[@]} ${host_dependencies[@]}
${c} RUN echo "--> CACHE MISS IN DOCKERFILE: pip3 packages." && \
${c} pip3 install ${python3_pip_dependencies[@]}
${c} RUN sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
${c} RUN locale-gen
WORKDIR ${DOCKER_ARMBIAN_TARGET_PATH}
ENV ARMBIAN_RUNNING_IN_CONTAINER=yes
ADD . ${DOCKER_ARMBIAN_TARGET_PATH}/
RUN echo "--> CACHE MISS IN DOCKERFILE: running Armbian requirements initialization." && \
/bin/bash "${DOCKER_ARMBIAN_TARGET_PATH}/compile.sh" requirements SHOW_LOG=yes && \
rm -rf "${DOCKER_ARMBIAN_TARGET_PATH}/output" "${DOCKER_ARMBIAN_TARGET_PATH}/.tmp" "${DOCKER_ARMBIAN_TARGET_PATH}/cache"
${c} RUN echo "--> CACHE MISS IN DOCKERFILE: running Armbian requirements initialization." && \
${c} /bin/bash "${DOCKER_ARMBIAN_TARGET_PATH}/compile.sh" requirements SHOW_LOG=yes && \
${c} rm -rf "${DOCKER_ARMBIAN_TARGET_PATH}/output" "${DOCKER_ARMBIAN_TARGET_PATH}/.tmp" "${DOCKER_ARMBIAN_TARGET_PATH}/cache"
INITIAL_DOCKERFILE
}