Skip to content

Commit a607e0a

Browse files
committed
test
1 parent 2392c72 commit a607e0a

File tree

2 files changed

+78
-56
lines changed

2 files changed

+78
-56
lines changed

.github/workflows/build-docker.yml

Lines changed: 60 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Get current date
2222
id: date
2323
run: |
24-
echo "DATE={$(date +'%Y%m%d')}" >> $GITHUB_ENV
24+
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
2525
2626
- uses: docker/metadata-action@v5
2727
id: metadata
@@ -35,58 +35,62 @@ jobs:
3535
labels: |
3636
maintainer=${{ github.repository_owner }}
3737
38-
# - uses: docker/setup-buildx-action@v3
39-
40-
# - uses: docker/login-action@v3
41-
# with:
42-
# registry: ghcr.io
43-
# username: ${{ github.repository_owner }}
44-
# password: ${{ secrets.GITHUB_TOKEN }}
45-
46-
# - uses: docker/build-push-action@v6
47-
# with:
48-
# context: .
49-
# platforms: linux/amd64
50-
# push: true
51-
# tags: ${{ steps.metadata.outputs.tags }}
52-
# labels: ${{ steps.metadata.outputs.labels }}
53-
# build-args: |
54-
# BASE_IMAGE=ubuntu:${{ matrix.version }}
55-
56-
# build-centos7:
57-
# runs-on: ubuntu-latest
58-
# permissions:
59-
# contents: read
60-
# packages: write
61-
62-
# steps:
63-
# - uses: actions/checkout@v4
64-
65-
# - uses: docker/metadata-action@v5
66-
# id: metadata
67-
# with:
68-
# images: |
69-
# ghcr.io/${{ github.repository_owner }}/xs-env
70-
# tags: |
71-
# centos7
72-
# centos7-${{ github.sha }}
73-
# labels: |
74-
# maintainer=${{ github.repository_owner }}
75-
76-
# - uses: docker/setup-buildx-action@v3
77-
78-
# - uses: docker/login-action@v3
79-
# with:
80-
# registry: ghcr.io
81-
# username: ${{ github.repository_owner }}
82-
# password: ${{ secrets.GITHUB_TOKEN }}
83-
84-
# - uses: docker/build-push-action@v6
85-
# with:
86-
# context: .
87-
# platforms: linux/amd64
88-
# push: true
89-
# tags: ${{ steps.metadata.outputs.tags }}
90-
# labels: ${{ steps.metadata.outputs.labels }}
91-
# build-args: |
92-
# BASE_IMAGE=ubuntu:${{ matrix.version }}
38+
- uses: docker/setup-buildx-action@v3
39+
40+
- uses: docker/login-action@v3
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.repository_owner }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- uses: docker/build-push-action@v6
47+
with:
48+
context: .
49+
platforms: linux/amd64
50+
push: true
51+
tags: ${{ steps.metadata.outputs.tags }}
52+
labels: ${{ steps.metadata.outputs.labels }}
53+
build-args: |
54+
BASE_IMAGE=ubuntu:${{ matrix.version }}
55+
56+
build-centos7:
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: read
60+
packages: write
61+
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- name: Get current date
66+
id: date
67+
run: |
68+
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
69+
70+
- uses: docker/metadata-action@v5
71+
id: metadata
72+
with:
73+
images: |
74+
ghcr.io/${{ github.repository_owner }}/xs-env
75+
tags: |
76+
centos7
77+
centos7-${{ env.DATE }}
78+
labels: |
79+
maintainer=${{ github.repository_owner }}
80+
81+
- uses: docker/setup-buildx-action@v3
82+
83+
- uses: docker/login-action@v3
84+
with:
85+
registry: ghcr.io
86+
username: ${{ github.repository_owner }}
87+
password: ${{ secrets.GITHUB_TOKEN }}
88+
89+
- uses: docker/build-push-action@v6
90+
with:
91+
context: .
92+
platforms: linux/amd64
93+
push: true
94+
tags: ${{ steps.metadata.outputs.tags }}
95+
labels: ${{ steps.metadata.outputs.labels }}
96+
file: ./centos7.Dockerfile

centos.Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM centos:7
2+
3+
# use baseurl instead of mirrorlist
4+
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
5+
RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
6+
RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
7+
RUN yum clean all && yum makecache
8+
9+
RUN yum install -y centos-release-scl
10+
# use baseurl instead of mirrorlist in CentOS-SCLo-scl.repo
11+
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
12+
RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
13+
RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
14+
RUN yum clean all && yum makecache
15+
16+
RUN yum install -y git dtc devtoolset-11 llvm-toolset-7 bison flex
17+
RUN echo "source /opt/rh/devtoolset-11/enable" >> /etc/profile
18+
RUN echo "source /opt/rh/llvm-toolset-7/enable" >> /etc/profile

0 commit comments

Comments
 (0)