Skip to content

Commit

Permalink
Fix bash.bashrc issue (#89)
Browse files Browse the repository at this point in the history
* fix bashrc
* better doc
* update docker_kit
  • Loading branch information
haobibo committed Mar 13, 2024
1 parent f28983e commit c0f6c2d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docker_atom/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docker_atom/work/script-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;") \
Expand Down Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions docker_base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
8 changes: 4 additions & 4 deletions docker_docker_kit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c0f6c2d

Please sign in to comment.