-
Notifications
You must be signed in to change notification settings - Fork 747
59 lines (50 loc) · 1.62 KB
/
build-images-registry.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
name: Build all-in-one images registry
on:
push:
branches: [master, express]
pull_request:
branches: [master]
schedule:
- cron: "0 16 * * *"
env:
IMAGE_REPO: "kubespheredev"
IMAGE_NAME: "images-registry"
IMAGE_TAG: "latest"
SKOPEO_VERSION: v1.2.0
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Extend free disk
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android
- name: Run docker registry
run: |
sudo docker run -d --name registry -v /var/lib/registry:/var/lib/registry -p 127.0.0.1:80:5000 registry:2
- name: Sync all images
shell: bash
run: |
bash scripts/sync-images.sh scripts/images-list.txt docker.io localhost
- name: Build skopeo binary
shell: bash
run: |
docker build -t skopeo:${SKOPEO_VERSION} -f scripts/build/Dockerfile.skopeo .
docker run -d --name skopeo skopeo:${SKOPEO_VERSION} sleep 60s
docker cp skopeo:/usr/bin/skopeo .
- name: Build images registry
shell: bash
run: |
sudo docker stop registry
sudo mv -f /var/lib/registry/docker .
sudo docker build -t ${IMAGE_REPO}/${IMAGE_NAME}:${IMAGE_TAG} -f scripts/build/Dockerfile.registry .
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push image
run: |
docker push ${IMAGE_REPO}/${IMAGE_NAME}:${IMAGE_TAG}