From c0f6c2ddcc074fc00e58a24be8c04a440add8f2f Mon Sep 17 00:00:00 2001 From: Bibo Hao Date: Wed, 13 Mar 2024 12:57:40 +0800 Subject: [PATCH] Fix bash.bashrc issue (#89) * fix bashrc * better doc * update docker_kit --- .github/workflows/build-docker.yml | 2 +- docker_atom/Dockerfile | 2 +- docker_atom/work/script-setup.sh | 4 ++-- docker_base/Dockerfile | 3 +-- docker_docker_kit/Dockerfile | 8 ++++---- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 5309ead..839868d 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -361,4 +361,4 @@ jobs: --env-file /tmp/docker.env \ -v $(pwd):/tmp \ -w /tmp \ - qpod/docker-kit python /opt/utils/image-syncer/run_jobs.py + ${DOCKER_IMG_PREFIX:-qpod}/docker-kit python /opt/utils/image-syncer/run_jobs.py diff --git a/docker_atom/Dockerfile b/docker_atom/Dockerfile index a6eb488..46b87ef 100644 --- a/docker_atom/Dockerfile +++ b/docker_atom/Dockerfile @@ -33,7 +33,7 @@ RUN set -x && cd /tmp \ && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \ && echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ - && mv /root/.bashrc /etc/profile.d/bash.bashrc \ + && mv /root/.bashrc /etc/profile.d/bash.bashrc.sh \ && LINE_SET_FLAG='export ENTER_PROFILE=$(date +%Y.%m%d.%H%M)' \ && LINE_CHK_FLAG='[ $BASH ] && [ -f /etc/profile ] && [ -z $ENTER_PROFILE ] && . /etc/profile' \ # Add a check variable `ENTER_PROFILE` to see if /etc/profile is executed or not diff --git a/docker_atom/work/script-setup.sh b/docker_atom/work/script-setup.sh index 16f2c13..624472e 100644 --- a/docker_atom/work/script-setup.sh +++ b/docker_atom/work/script-setup.sh @@ -40,7 +40,7 @@ EOF && conda update --all --quiet --yes # remove non-necessary folder/symlink "python3.1" exists - rm -rf "${CONDA_PREFIX}"/bin/python3.1 + rm -rf "${CONDA_PREFIX}"/bin/python3.1 "${CONDA_PREFIX}"/lib/python3.1 # These conda pkgs shouldn't be removed (otherwise will cause RemoveError) since they are directly required by conda: pip setuptools pycosat pyopenssl requests ruamel_yaml # CONDA_PY_PKGS=$(conda list | grep "py3" | cut -d " " -f 1 | sed "/#/d;/conda/d;/pip/d;/setuptools/d;/pycosat/d;/pyopenssl/d;/requests/d;/ruamel_yaml/d;") \ @@ -112,7 +112,7 @@ setup_java_base() { elif [ "$VER_JDK" -gt 8 ] ; then URL_OPENJDK=${JDK_URL_MSFT} else - echo "ORCA download URL ref: ${JDK_URL_ORCA}" + echo "ORCA JDK8 download URL ref: ${JDK_URL_ORCA}" URL_OPENJDK="https://javadl.oracle.com/webapps/download/GetFile/1.8.0_361-b09/0ae14417abb444ebb02b9815e2103550/linux-i586/jdk-8u361-linux-${ARCH}.tar.gz" fi diff --git a/docker_base/Dockerfile b/docker_base/Dockerfile index 77cb0ed..11b2be7 100644 --- a/docker_base/Dockerfile +++ b/docker_base/Dockerfile @@ -24,8 +24,7 @@ RUN set -x && source /opt/utils/script-setup.sh \ && PYTHON_PTH_FILE=$("${CONDA_PREFIX}"/bin/python3 -c 'import sys;print(sys.path[-1]+"/usr_share.pth")') \ && echo "/usr/share/pyshared/" >> "${PYTHON_PTH_FILE}" \ && echo "/usr/share/python3/" >> "${PYTHON_PTH_FILE}" \ - && rm -rf $(/usr/bin/python3 -c 'import sys; print(" ".join(i for i in sys.path if "python" in i))') /usr/bin/python3* \ - && rm -rf "${CONDA_PREFIX}"/lib/python3.1 /usr/lib/python${PYTHON_VERSION} \ + && rm -rf $(/usr/bin/python3 -c 'import sys; print(" ".join(i for i in sys.path if "python" in i))') /usr/bin/python3* /usr/lib/python${PYTHON_VERSION} \ && ln -sf "${CONDA_PREFIX}"/lib/python${PYTHON_VERSION} /usr/lib/ \ && ln -sf "${CONDA_PREFIX}"/bin/python3.* /usr/bin/ \ && ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python \ diff --git a/docker_docker_kit/Dockerfile b/docker_docker_kit/Dockerfile index 5f91212..dffd4bd 100644 --- a/docker_docker_kit/Dockerfile +++ b/docker_docker_kit/Dockerfile @@ -5,13 +5,13 @@ ARG BASE_IMG="base" FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG} LABEL maintainer="haobibo@gmail.com" +ENV XDG_RUNTIME_DIR="/tmp" COPY work /opt/utils/ RUN source /opt/utils/script-setup.sh \ && setup_docker_compose && setup_docker_syncer \ && pip install -U PyYaml \ - && ln -sf /usr/bin/image-syncer /opt/utils/image-syncer/ - -# Clean up and display components version information... -RUN source /opt/utils/script-utils.sh && install__clean && list_installed_packages + && ln -sf /usr/bin/image-syncer /opt/utils/image-syncer/ \ + # Clean up and display components version information... + && source /opt/utils/script-utils.sh && install__clean && list_installed_packages