Skip to content

Commit a4498c9

Browse files
committed
Fix pacman mirror list by country arg
1 parent b769764 commit a4498c9

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

.env.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ DOCKER_HOST_GID=1000
77
DOCKER_USER=developer
88
DOCKER_USER_HOME=/home/developer
99

10+
MIRROR_LIST_COUNTRY=RU
1011
BUILD_PACKAGES="pyenv git gnupg sudo postgresql-libs mariadb-libs openmp"
1112
VIM_PACKAGES="python vim ctags ripgrep bat npm nodejs-lts-iron"
1213

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ARG DOCKER_HOST_UID=10000
44
ARG DOCKER_HOST_GID=10000
55
ARG DOCKER_USER=devuser
66
ARG DOCKER_USER_HOME=/home/devuser
7+
ARG MIRROR_LIST_COUNTRY=RU
78
ARG BUILD_PACKAGES="pyenv git gnupg sudo postgresql-libs mariadb-libs openmp"
89
ARG PYTHON_VERSION=3.13
910
ARG POETRY_VERSION=1.8.5
@@ -18,7 +19,11 @@ RUN set -eux; \
1819
useradd --no-log-init -g $DOCKER_USER --uid=$DOCKER_HOST_UID \
1920
-d $DOCKER_USER_HOME -ms /bin/bash $DOCKER_USER
2021
RUN mkdir /application && chown $DOCKER_USER:$DOCKER_USER /application
21-
RUN pacman -Sy && pacman -S --noconfirm $BUILD_PACKAGES
22+
RUN curl -s \
23+
"https://archlinux.org/mirrorlist/?country=$MIRROR_LIST_COUNTRY&protocol=http&protocol=https&ip_version=4" \
24+
| sed -e 's/^#Server/Server/' -e '/^#/d' > /etc/pacman.d/mirrorlist
25+
RUN pacman -Syu --noconfirm
26+
RUN pacman -S --noconfirm $BUILD_PACKAGES
2227
RUN echo "${DOCKER_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
2328
ENV PYENV_ROOT=$DOCKER_USER_HOME/.pyenv
2429
ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH

compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ services:
99
- DOCKER_HOST_GID=${DOCKER_HOST_GID}
1010
- DOCKER_USER=${DOCKER_USER}
1111
- DOCKER_USER_HOME=${DOCKER_USER_HOME}
12+
- MIRROR_LIST_COUNTRY=${MIRROR_LIST_COUNTRY}
1213
- BUILD_PACKAGES=${BUILD_PACKAGES}
1314
- VIM_PACKAGES=${VIM_PACKAGES}
1415
- PYTHON_VERSION=${PYTHON_VERSION}

0 commit comments

Comments
 (0)