-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Build and publish Docker Registry image | ||
Check warning on line 1 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-integrationtest-services)
Check warning on line 1 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-stub-server)
|
||
|
||
on: | ||
Check warning on line 3 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-integrationtest-services)
Check warning on line 3 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-stub-server)
|
||
push: | ||
tags: | ||
- "*" | ||
paths: | ||
- "registry/**" | ||
pull_request: | ||
paths: | ||
- "registry/**" | ||
|
||
env: | ||
REGISTRY_VERSION: 2.8.3 | ||
REGCTL_VERSION: 0.8.0 | ||
DOCKERFILE_CONTEXT: registry | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
build-args: | ||
- mcvs-registry | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Install regctl | ||
uses: regclient/actions/regctl-installer@main | ||
with: | ||
release: ${{ env.REGCTL_VERSION }} | ||
|
||
- name: Create registry backup directory | ||
run: mkdir -p ./${{ env.DOCKERFILE_CONTEXT }}/backup-registry | ||
|
||
- name: Pull images data and prepare context directory | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
# run local tmp registry | ||
docker run -d -p 5000:5000 --name mcvs-registry-tmp registry:${{ env.REGISTRY_VERSION }} | ||
Check failure on line 46 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-integrationtest-services)
Check failure on line 46 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-stub-server)
|
||
# copy specififc images from specific sources | ||
regctl image copy --digest-tags public.ecr.aws/datadog/agent:7.59.0 localhost:5000/datadog/agent:7.59.0 | ||
Check failure on line 49 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-integrationtest-services)
Check failure on line 49 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-stub-server)
|
||
regctl image copy --digest-tags public.ecr.aws/nginx/nginx:1.27.0 localhost:5000/nginx/nginx:1.27.0 | ||
Check failure on line 50 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-integrationtest-services)
Check failure on line 50 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-stub-server)
|
||
# export images files to backup directory | ||
docker cp mcvs-registry-tmp:/var/lib/registry ./${{ env.DOCKERFILE_CONTEXT }}/backup-registry | ||
Check failure on line 53 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-integrationtest-services)
Check failure on line 53 in .github/workflows/docker-registry.yml GitHub Actions / mcvs-docker-action (mcvs-stub-server)
|
||
# clean up the registry container | ||
docker rm -f mcvs-registry-tmp | ||
- name: Run MCVS Docker Action | ||
uses: schubergphilis/[email protected] | ||
with: | ||
build-args: ${{ matrix.build-args }} | ||
dockle-accept-key: "curl,HOME,libcrypto3,libssl3,PATH" | ||
images: ghcr.io/${{ github.repository }}/${{ matrix.build-args }} | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
# context: ${{ env.DOCKERFILE_CONTEXT }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM registry:2.8.3 | ||
|
||
COPY ./backup-registry /var/lib/registry | ||
|
||
COPY ./config-example.yml /etc/docker/registry/config.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 0.1 | ||
Check warning on line 1 in registry/config-example.yml GitHub Actions / mcvs-docker-action (mcvs-integrationtest-services)
Check warning on line 1 in registry/config-example.yml GitHub Actions / mcvs-docker-action (mcvs-stub-server)
|
||
log: | ||
fields: | ||
service: registry | ||
storage: | ||
cache: | ||
blobdescriptor: "" | ||
filesystem: | ||
rootdirectory: /var/lib/registry | ||
http: | ||
addr: :5000 | ||
headers: | ||
X-Content-Type-Options: [nosniff] | ||
health: | ||
storagedriver: | ||
enabled: true | ||
interval: 10s | ||
threshold: 3 |