Closed flying19880517 closed 1 year ago
Ok, I will try to see if this can be implemented in a generic way, to support all baseimage types.
We can check if a env is empty, and if it is, do nothing.
I use it in a Dockerfile to change it.
ENV APT_MIRROR="mirrors.xxx.com"
RUN sed -i "s/deb.debian.org/${APT_MIRROR}/g" /etc/apt/sources.list \
&& sed -i "s/security.debian.org/${APT_MIRROR}/g" /etc/apt/sources.list \
&& sed -i "s/archive.ubuntu.com/${APT_MIRROR}/g" /etc/apt/sources.list \
&& sed -i "s/security.ubuntu.com/${APT_MIRROR}/g" /etc/apt/sources.list \
&& apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
Ok, I will try to see if this can be implemented in a generic way, to support all baseimage types.
This is now implemented via the PACKAGES_MIRROR
environment variable.
In my country, install packages from alpinelinux.org are very slow, usually we use mirrors for speed. How about support set mirror url by Environment Variables?
https://github.com/jlesage/docker-baseimage-gui/blob/a246245ad6e7a76a0083fb2218faa15f8b5d870b/README.md?plain=1#L159 https://github.com/jlesage/docker-baseimage-gui/blob/a246245ad6e7a76a0083fb2218faa15f8b5d870b/rootfs/etc/cont-init.d/10-cjk-font.sh#L13