mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/boypt/openssh-rpms.git
synced 2026-09-20 08:03:38 +08:00
fix: avoid action stragy
This commit is contained in:
22
.github/workflows/build-images.yml
vendored
22
.github/workflows/build-images.yml
vendored
@@ -19,27 +19,27 @@ jobs:
|
||||
- tag_suffix: el5
|
||||
dockerfile: ./docker/Dockerfile.centos5
|
||||
build_args: |
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
- tag_suffix: el6
|
||||
dockerfile: ./docker/Dockerfile.centos
|
||||
build_args: |
|
||||
VERSION_NUM=6
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
- tag_suffix: el7
|
||||
dockerfile: ./docker/Dockerfile.centos
|
||||
build_args: |
|
||||
VERSION_NUM=7
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
- tag_suffix: el8
|
||||
dockerfile: ./docker/Dockerfile.centos
|
||||
build_args: |
|
||||
VERSION_NUM=8
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
- tag_suffix: el9
|
||||
dockerfile: ./docker/Dockerfile.centos-stream
|
||||
build_args: |
|
||||
VERSION_NUM=9
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -48,10 +48,10 @@ jobs:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run Shell
|
||||
- name: Run
|
||||
run: |
|
||||
env DOCKERBUILD=1 ./pullsrc.sh
|
||||
sed -i 's|\.cn||g' ./docker/*
|
||||
sed -i 's|mirrors.\+\.cn|mirror.centos.org|g' ./docker/*
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
@@ -86,17 +86,17 @@ jobs:
|
||||
dockerfile: ./docker/Dockerfile.centos
|
||||
build_args: |
|
||||
VERSION_NUM=7
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
- tag_suffix: aarch64_el8
|
||||
dockerfile: ./docker/Dockerfile.centos-stream
|
||||
build_args: |
|
||||
VERSION_NUM=8
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
- tag_suffix: aarch64_el9
|
||||
dockerfile: ./docker/Dockerfile.centos-stream
|
||||
build_args: |
|
||||
VERSION_NUM=9
|
||||
CHINA_MIRROR=0
|
||||
MIRROR=0
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
|
||||
- name: Run Shell
|
||||
run: |
|
||||
sed -i 's|\.cn||g' ./docker/*
|
||||
sed -i 's|mirrors.\+\.cn|mirror.centos.org|g' ./docker/*
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ARG VERSION_NUM="2023"
|
||||
FROM amazonlinux:$VERSION_NUM
|
||||
ARG VERSION_NUM
|
||||
ARG CHINA_MIRROR=0
|
||||
ARG MIRROR=0
|
||||
LABEL Author="Rex Zhou <zrx879582094@gmail.com>"
|
||||
|
||||
WORKDIR /data
|
||||
@@ -9,7 +9,7 @@ WORKDIR /data
|
||||
# Copy all files
|
||||
COPY . /data
|
||||
|
||||
RUN export CHINA_MIRROR="$CHINA_MIRROR" && \
|
||||
RUN export MIRROR="$MIRROR" && \
|
||||
bash ./docker/modify_yum_source.sh && \
|
||||
if [ "$VERSION_NUM" = "2023" ]; then \
|
||||
yum makecache timer && yum install -y libnsl systemd-devel; \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ARG VERSION_NUM="7"
|
||||
FROM centos:$VERSION_NUM
|
||||
ARG VERSION_NUM
|
||||
ARG CHINA_MIRROR=0
|
||||
ARG MIRROR=0
|
||||
LABEL Author="Rex Zhou <zrx879582094@gmail.com>"
|
||||
|
||||
WORKDIR /data
|
||||
@@ -9,7 +9,7 @@ WORKDIR /data
|
||||
# Copy all files
|
||||
COPY ./docker/ /data/docker/
|
||||
|
||||
RUN export CHINA_MIRROR="$CHINA_MIRROR" && \
|
||||
RUN export MIRROR="$MIRROR" && \
|
||||
bash ./docker/modify_yum_source.sh && \
|
||||
if [ "$VERSION_NUM" = "8" ]; then \
|
||||
yum install -y perl perl-IPC-Cmd perl-Time-Piece systemd-devel openssl-devel && \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ARG VERSION_NUM="9"
|
||||
FROM quay.io/centos/centos:stream$VERSION_NUM
|
||||
ARG VERSION_NUM
|
||||
ARG CHINA_MIRROR=0
|
||||
ARG MIRROR=0
|
||||
LABEL Author="Rex Zhou <zrx879582094@gmail.com>"
|
||||
|
||||
WORKDIR /data
|
||||
@@ -20,7 +20,7 @@ RUN if [ "$VERSION_NUM" = "8" ]; then \
|
||||
yum install -y perl 'dnf-command(config-manager)' && \
|
||||
yum config-manager --set-enabled powertools; \
|
||||
else \
|
||||
if [ "$CHINA_MIRROR" != "0" ]; then \
|
||||
if [ "$MIRROR" != "0" ]; then \
|
||||
MIRROR_URL="https://mirrors.ustc.edu.cn" && \
|
||||
sed -i "s|MIRROR_HOLDER|$MIRROR_URL/centos-stream|" /data/docker/modify_dnf_source.pl && \
|
||||
yum install -y perl && \
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
FROM centos:5 AS builder
|
||||
ARG CHINA_MIRROR=1
|
||||
ARG MIRROR=1
|
||||
WORKDIR /data
|
||||
|
||||
COPY ./docker/*.sh /data/docker/
|
||||
COPY ./downloads/perl* /data/
|
||||
|
||||
RUN export CHINA_MIRROR="$CHINA_MIRROR" && \
|
||||
RUN export MIRROR="$MIRROR" && \
|
||||
bash ./docker/modify_yum_source.sh && \
|
||||
yum install -y gcc44 make
|
||||
|
||||
@@ -16,13 +16,13 @@ RUN rm -rf perl-*.tar.gz perl
|
||||
|
||||
|
||||
FROM centos:5
|
||||
ARG CHINA_MIRROR=1
|
||||
ARG MIRROR=1
|
||||
ENV PATH=/usr/local/perl/bin:$PATH
|
||||
WORKDIR /data
|
||||
COPY --from=builder /usr/local/perl /usr/local/perl
|
||||
COPY ./docker/*.sh /data/docker/
|
||||
|
||||
RUN export CHINA_MIRROR="$CHINA_MIRROR" && \
|
||||
RUN export MIRROR="$MIRROR" && \
|
||||
bash ./docker/modify_yum_source.sh && \
|
||||
yum install -y gcc44 autoconf automake make rpm-build setarch pam-devel krb5-devel zlib-devel && \
|
||||
sed 's|]$|-i386]|;s|\$basearch|i386|g' /etc/yum.repos.d/CentOS-Base.repo > /etc/yum.repos.d/CentOS-Base-i386.repo && \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ARG VERSION_NUM="24.03"
|
||||
FROM openeuler/openeuler:$VERSION_NUM
|
||||
ARG VERSION_NUM
|
||||
ARG CHINA_MIRROR=0
|
||||
ARG MIRROR=0
|
||||
LABEL Author="Rex Zhou <zrx879582094@gmail.com>"
|
||||
|
||||
WORKDIR /data
|
||||
@@ -11,7 +11,7 @@ WORKDIR /data
|
||||
COPY . /data
|
||||
|
||||
# Official webpage: https://www.openeuler.openatom.cn/zh/blog/2024-10-15-boostYum/2024-10-15-boostYum.html
|
||||
RUN if [ "$CHINA_MIRROR" != "0" ]; then \
|
||||
RUN if [ "$MIRROR" != "0" ]; then \
|
||||
MIRROR_URL="mirrors.163.com/openeuler" && \
|
||||
sed -i.bak \
|
||||
"s|repo.openeuler.org|$MIRROR_URL|g;s|^metalink|#metalink|g" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ARG VERSION_NUM="9"
|
||||
FROM rockylinux:$VERSION_NUM
|
||||
ARG VERSION_NUM
|
||||
ARG CHINA_MIRROR=0
|
||||
ARG MIRROR=0
|
||||
LABEL Author="Rex Zhou <zrx879582094@gmail.com>"
|
||||
|
||||
WORKDIR /data
|
||||
@@ -11,7 +11,7 @@ WORKDIR /data
|
||||
COPY . /data
|
||||
|
||||
# Official webpage: https://developer.aliyun.com/mirror/rockylinux
|
||||
RUN if [ "$CHINA_MIRROR" != "0" ]; then \
|
||||
RUN if [ "$MIRROR" != "0" ]; then \
|
||||
MIRROR_URL="https://mirrors.aliyun.com/rockylinux" && \
|
||||
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
|
||||
-e "s|^#baseurl=http://dl.rockylinux.org/\$contentdir|baseurl=$MIRROR_URL|g" \
|
||||
|
||||
@@ -34,7 +34,7 @@ Choose only the platforms you need and run the corresponding commands.
|
||||
|
||||
```bash
|
||||
# Build Docker image
|
||||
docker build -t elssh:el5 -f ./docker/Dockerfile.centos5 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh:el5 -f ./docker/Dockerfile.centos5 --build-arg MIRROR=0 .
|
||||
|
||||
# Build 64-bit packages (recommended)
|
||||
docker run --rm -v .:/data -e "M32=0" elssh:el5
|
||||
@@ -46,28 +46,28 @@ docker run --rm -v .:/data -e "M32=1" elssh:el5
|
||||
#### For EL6 (CentOS 6)
|
||||
|
||||
```bash
|
||||
docker build -t elssh:el6 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=6 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh:el6 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=6 --build-arg MIRROR=0 .
|
||||
docker run --rm -v .:/data elssh:el6
|
||||
```
|
||||
|
||||
#### For EL7 (CentOS 7)
|
||||
|
||||
```bash
|
||||
docker build -t elssh:el7 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=7 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh:el7 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=7 --build-arg MIRROR=0 .
|
||||
docker run --rm -v .:/data elssh:el7
|
||||
```
|
||||
|
||||
#### For EL8 (CentOS 8 / RHEL 8 / Rocky 8 / AlmaLinux 8)
|
||||
|
||||
```bash
|
||||
docker build -t elssh:el8 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=8 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh:el8 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=8 --build-arg MIRROR=0 .
|
||||
docker run --rm -v .:/data elssh:el8
|
||||
```
|
||||
|
||||
#### For EL9 (CentOS Stream 9 / RHEL 9 / Rocky 9 / AlmaLinux 9)
|
||||
|
||||
```bash
|
||||
docker build -t elssh:el9 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh:el9 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 --build-arg MIRROR=0 .
|
||||
docker run --rm -v .:/data elssh:el9
|
||||
```
|
||||
|
||||
@@ -80,7 +80,7 @@ docker build -t elssh_aarch64:el8 \
|
||||
--platform linux/arm64 \
|
||||
-f ./docker/Dockerfile.centos-stream \
|
||||
--build-arg VERSION_NUM=8 \
|
||||
--build-arg CHINA_MIRROR=0 .
|
||||
--build-arg MIRROR=0 .
|
||||
|
||||
docker run --rm -v .:/data --platform linux/arm64 elssh_aarch64:el8
|
||||
```
|
||||
@@ -92,7 +92,7 @@ docker build -t elssh_aarch64:el9 \
|
||||
--platform linux/arm64 \
|
||||
-f ./docker/Dockerfile.centos-stream \
|
||||
--build-arg VERSION_NUM=9 \
|
||||
--build-arg CHINA_MIRROR=0 .
|
||||
--build-arg MIRROR=0 .
|
||||
|
||||
docker run --rm -v .:/data --platform linux/arm64 elssh_aarch64:el9
|
||||
```
|
||||
@@ -101,13 +101,13 @@ docker run --rm -v .:/data --platform linux/arm64 elssh_aarch64:el9
|
||||
|
||||
| Argument | Values | Description |
|
||||
|-------------------|--------|-----------|
|
||||
| `CHINA_MIRROR` | 0 or 1 | Set to `1` if you are in China and want to use faster domestic mirrors |
|
||||
| `MIRROR` | 0 or 1 | Set to `1` if you are in China and want to use faster domestic mirrors |
|
||||
| `VERSION_NUM` | 6,7,8,9| Specifies the target EL version (used in most Dockerfiles) |
|
||||
| `M32` (EL5 only) | 0 or 1 | `0` = 64-bit, `1` = 32-bit |
|
||||
|
||||
**Example for users in China:**
|
||||
|
||||
Add `--build-arg CHINA_MIRROR=1` to the `docker build` command.
|
||||
Add `--build-arg MIRROR=1` to the `docker build` command.
|
||||
|
||||
## Output Location
|
||||
|
||||
@@ -141,10 +141,10 @@ Each subdirectory contains the generated `.rpm` files (including debuginfo if av
|
||||
```bash
|
||||
env ALL=1 ./pullsrc.sh
|
||||
|
||||
docker build -t elssh:el8 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=8 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh:el8 -f ./docker/Dockerfile.centos --build-arg VERSION_NUM=8 --build-arg MIRROR=0 .
|
||||
docker run --rm -v .:/data elssh:el8
|
||||
|
||||
docker build -t elssh:el9 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh:el9 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 --build-arg MIRROR=0 .
|
||||
docker run --rm -v .:/data elssh:el9
|
||||
```
|
||||
|
||||
@@ -153,13 +153,13 @@ docker run --rm -v .:/data elssh:el9
|
||||
```bash
|
||||
env ALL=1 ./pullsrc.sh
|
||||
|
||||
docker build -t elssh_aarch64:el9 --platform linux/arm64 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 --build-arg CHINA_MIRROR=0 .
|
||||
docker build -t elssh_aarch64:el9 --platform linux/arm64 -f ./docker/Dockerfile.centos-stream --build-arg VERSION_NUM=9 --build-arg MIRROR=0 .
|
||||
docker run --rm -v .:/data --platform linux/arm64 elssh_aarch64:el9
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **Slow downloads**: Use `CHINA_MIRROR=1`
|
||||
- **Slow downloads**: Use `MIRROR=1`
|
||||
- **Permission issues**: Run `chown -R $USER output/` after building
|
||||
- **Docker build fails on first run**: This is normal — it needs to download base images and dependencies
|
||||
- **ARM64 builds**: Requires a machine with ARM64 support or Docker Buildx multi-platform enabled
|
||||
|
||||
@@ -10,7 +10,7 @@ RELEASE_VER=$(rpm --eval '%{?dist}')
|
||||
|
||||
# Cent OS 5 is NOT support modern SSL protocol, so use plain HTTP protocol.
|
||||
if [ "$RELEASE_VER" != ".el5" ]; then
|
||||
if [ "$CHINA_MIRROR" != "0" ]; then
|
||||
if [ "$MIRROR" != "0" ]; then
|
||||
# Using USTC mirror, which is much useful for Chinese users.
|
||||
MIRROR_URL="https://mirrors.ustc.edu.cn/centos-vault";
|
||||
AWS_DOMAIN="amazonaws.com.cn"
|
||||
|
||||
Reference in New Issue
Block a user