Skip to content

Commit

Permalink
Replace centos with rocky
Browse files Browse the repository at this point in the history
CentOS no longer updates its image on Docker Hub, and it is nearly at the end of its life.
  • Loading branch information
taoky committed Jun 5, 2024
1 parent b481a19 commit 8238be9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
include:
- IMAGE_NAME: alpine
- IMAGE_NAME: centos
- IMAGE_NAME: rocky
- IMAGE_NAME: debian
- IMAGE_NAME: fedora
- IMAGE_NAME: ubuntu
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The fast way to use USTC mirrors in your container.

## Available distros

`ustclug/ubuntu`, `ustclug/debian`, `ustclug/fedora`, `ustclug/centos`, `ustclug/alpine`.
`ustclug/ubuntu`, `ustclug/debian`, `ustclug/fedora`, ~~`ustclug/centos`~~, `ustclug/rocky`, `ustclug/alpine`.

## Example

Expand Down
17 changes: 0 additions & 17 deletions build-centos.sh

This file was deleted.

22 changes: 22 additions & 0 deletions build-rocky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
source common.sh
docker-tags rockylinux |
while read tag; do
dockerfile=$(mktemp)
cat << EOF > $dockerfile
FROM rockylinux:$tag
RUN sed -i \
-e 's/mirrorlist/#mirrorlist/g' \
-e 's/#baseurl/baseurl/g' \
-e 's|dl.rockylinux.org/\$contentdir|mirrors.ustc.edu.cn/rocky|g' \
/etc/yum.repos.d/Rocky-*.repo || \
sed -i \
-e 's/mirrorlist/#mirrorlist/g' \
-e 's/#baseurl/baseurl/g' \
-e 's|dl.rockylinux.org/\$contentdir|mirrors.ustc.edu.cn/rocky|g' \
/etc/yum.repos.d/rocky*.repo
EOF
docker build -f $dockerfile -t ustclug/rocky:$tag .
docker push ustclug/rocky:$tag
rm $dockerfile
done

0 comments on commit 8238be9

Please sign in to comment.