Skip to content

Commit

Permalink
docker build locale
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhiHanZ committed Jan 13, 2022
1 parent ae5a2b5 commit d8e329e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docker/build-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@ RUN curl https://sh.rustup.rs -sSf -sSf |\
RUN mkdir -p /home/rust/libs /home/rust/src /home/rust/.cargo && \
ln -s /opt/rust/cargo/config /home/rust/.cargo/config
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update -y && apt-get install -yq apt-utils && export DEBIAN_FRONTEND=noninteractive && apt-get install -yq psmisc && python3 -m pip install boto3 "moto[all]" yapf shfmt-py
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update -y && apt-get install -yq apt-utils && apt-get install -yq psmisc procps locales && python3 -m pip install boto3 "moto[all]" yapf shfmt-py coscmd PyYAML
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
5 changes: 3 additions & 2 deletions scripts/setup/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ START_COMMAND=("/bin/bash" "-lc" "groupadd --gid $(id -g) -f databendgroup \
&& chown -R databendbuild:databendgroup /source \
&& chown -R databendbuild:databendgroup /opt/rust/cargo \
&& chown -R databendbuild:databendgroup /tmp \
&& sudo -EHs -u databendbuild bash -c 'cd /source && RUST_BACKTRACE=full env CARGO_HOME=/opt/rust/cargo PATH=/home/rust/.cargo/bin:/opt/rust/cargo/bin:/usr/local/musl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin $*'")
&& sudo -EHs -u databendbuild bash -c 'cd /source && export LC_NUMERIC='de_DE.UTF-8' && \
export LC_ALL=C && RUST_BACKTRACE=full env CARGO_HOME=/opt/rust/cargo PATH=/home/rust/.cargo/bin:/opt/rust/cargo/bin:/usr/local/musl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin $*'")

[[ -f .git ]] && [[ ! -d .git ]] && DOCKER_OPTIONS+=(-v "$(git rev-parse --git-common-dir):$(git rev-parse --git-common-dir)")
[[ -n "${SSH_AUTH_SOCK}" ]] && DOCKER_OPTIONS+=(-v "${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}" -e SSH_AUTH_SOCK)
Expand All @@ -32,5 +33,5 @@ docker run --rm \
-v "${SOURCE_DIR}":"${SOURCE_DIR_MOUNT_DEST}" \
-v "${CARGO_GIT_DIR}":"/opt/rust/cargo/git" \
-v "${CARGO_REGISTRY_DIR}":"/opt/rust/cargo/registry" \
zhihanz/build-tool:v4 \
zhihanz/build-tool:rc1 \
"${START_COMMAND[@]}"

0 comments on commit d8e329e

Please sign in to comment.