Skip to content

Commit f0cd3d0

Browse files
author
Dev_Nergis
committed
사용자 지정 미러 추가
1 parent dfd5139 commit f0cd3d0

3 files changed

Lines changed: 27 additions & 129 deletions

File tree

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
FROM ubuntu:latest
22

33
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV MIRROR_URL=http.krfoss.org
45

5-
WORKDIR test
6+
COPY init.sh .
7+
8+
WORKDIR /test
69

710
RUN apt-get update -y && \
811
apt-get upgrade -y && \
9-
apt-get install -y ca-certificates curl
10-
11-
RUN curl -sSL https://http.krfoss.org/pack/cm.sh | bash && apt-get clean
12+
apt-get install -y ca-certificates && \
13+
apt-get clean
1214

13-
ENTRYPOINT ["/bin/bash", "-c", "apt update -y && apt-get download -y a*"]
15+
ENTRYPOINT ["/bin/bash", "-c", "bash /init.sh && apt-get download -y a*"]
1416

1517
CMD [""]

cm.sh

Lines changed: 0 additions & 124 deletions
This file was deleted.

init.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
CODENAME=$(lsb_release -cs 2>/dev/null || grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release)
4+
5+
cat > /etc/apt/sources.list.d/ubuntu.sources << EOF
6+
Types: deb deb-src
7+
URIs: https://${MIRROR_URL}/ubuntu/
8+
Suites: $CODENAME $CODENAME-updates $CODENAME-backports
9+
Components: main restricted universe multiverse
10+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
11+
12+
Types: deb deb-src
13+
URIs: https://${MIRROR_URL}/ubuntu/
14+
Suites: $CODENAME-security
15+
Components: main restricted universe multiverse
16+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
17+
EOF
18+
19+
apt update -y
20+
apt upgrade -y

0 commit comments

Comments
 (0)