-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
132 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build Skopeo | ||
|
||
env: | ||
TZ: Asia/Shanghai | ||
|
||
on: | ||
schedule: | ||
- cron: '0 8 * * 6' | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
name: build skopeo image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GHCRIO }} | ||
- name: Login DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build skopeo | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: skopeo | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
pull: true | ||
tags: | | ||
ghcr.io/ysicing/skopeo | ||
ysicing/skopeo | ||
ttl.sh/ysicing/skopeo | ||
- name: Trivy vulnerability scanner skopeo | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: 'ghcr.io/ysicing/skopeo' | ||
format: 'github' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM ysicing/debian AS Get | ||
|
||
RUN wget https://github.com/distribution/distribution/releases/download/v2.8.3/registry_2.8.3_linux_amd64.tar.gz \ | ||
&& tar -zxvf registry_2.8.3_linux_amd64.tar.gz \ | ||
&& mv registry /usr/bin/registry | ||
|
||
FROM ysicing/debian | ||
|
||
COPY --from=Get /usr/bin/registry /usr/bin/registry | ||
|
||
COPY config.yml /config.yml | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
EXPOSE 5000 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: 0.1 | ||
log: | ||
fields: | ||
service: registry | ||
storage: | ||
delete: | ||
enabled: true | ||
cache: | ||
blobdescriptor: inmemory | ||
filesystem: | ||
rootdirectory: /var/lib/registry | ||
http: | ||
addr: :5000 | ||
headers: | ||
X-Content-Type-Options: [nosniff] | ||
Access-Control-Expose-Headers: ['Docker-Content-Digest'] | ||
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE'] | ||
Access-Control-Allow-Origin: ['*'] | ||
proxy: | ||
remoteurl: https://registry-1.docker.io | ||
health: | ||
storagedriver: | ||
enabled: true | ||
interval: 10s | ||
threshold: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "$PROXY_REMOTE_URL" ]; then | ||
sed -i "s|registry-1.docker.io|$PROXY_REMOTE_URL|g" /config.yml | ||
fi | ||
|
||
if [ "$1" == "bash" ]; then | ||
exec /bin/bash | ||
else | ||
exec /usr/bin/registry serve /config.yml | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM ysicing/debian | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install --no-install-recommends --no-install-suggests -y skopeo \ | ||
&& apt-get autoremove \ | ||
&& apt-get clean \ | ||
&& rm -rf \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/var/lib/apt/lists/* | ||
|
||
ENTRYPOINT ["/usr/bin/skopeo"] |