Skip to content

Commit 9351ca4

Browse files
committed
Migrate to Quay and ECR
1 parent 90eeba5 commit 9351ca4

File tree

3 files changed

+109
-84
lines changed

3 files changed

+109
-84
lines changed

.github/workflows/build-push.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: build and push on main and tags
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v[0-9]+.[0-9]+.[0-9]+
9+
- v[0-9]+.[0-9]+.[0-9]+-[0-9]+
10+
pull_request:
11+
12+
env:
13+
GITHUB_ROLE_ARN: arn:aws:iam::461800378586:role/GitHubECRPublic
14+
15+
permissions:
16+
id-token: write # Required for OIDC
17+
contents: read # This is required for actions/checkout
18+
19+
jobs:
20+
build_and_push:
21+
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Get repo name
28+
id: image_name
29+
run: |
30+
sed -E -e 's/docker-//' -e 's/^/image_name=/' <<<"${{ github.repository }}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Docker meta
33+
id: meta
34+
uses: docker/metadata-action@v4
35+
with:
36+
# list of Docker images to use as base name for tags
37+
images: |
38+
quay.io/${{ steps.image_name.outputs.image_name }}
39+
public.ecr.aws/${{ steps.image_name.outputs.image_name }}
40+
# generate Docker tags based on the following events/attributes
41+
tags: |
42+
# type=schedule
43+
type=ref,event=branch
44+
type=ref,event=pr
45+
type=semver,pattern={{version}}
46+
type=semver,pattern={{major}}.{{minor}}
47+
# type=sha
48+
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v2
51+
52+
- name: Set up Docker Buildx
53+
id: buildx
54+
uses: docker/setup-buildx-action@v2
55+
56+
# The values provided to these two AWS steps are always the same for Panubo owned repos
57+
- name: Configure AWS Credentials
58+
uses: aws-actions/configure-aws-credentials@v1-node16
59+
with:
60+
role-to-assume: ${{ env.GITHUB_ROLE_ARN }}
61+
aws-region: us-east-1
62+
63+
- name: Login to ECR
64+
if: github.event_name != 'pull_request'
65+
uses: docker/login-action@v2
66+
with:
67+
registry: public.ecr.aws
68+
69+
- name: Login to Quay.io
70+
if: github.event_name != 'pull_request'
71+
uses: docker/login-action@v2
72+
with:
73+
registry: quay.io
74+
username: ${{ secrets.PANUBUILD_QUAYIO_USERNAME }}
75+
password: ${{ secrets.PANUBUILD_QUAYIO_TOKEN }}
76+
77+
# - name: Setup BATS
78+
# uses: mig4/setup-bats@v1
79+
# with:
80+
# bats-version: 1.7.0
81+
82+
- name: Build and export to Docker
83+
uses: docker/build-push-action@v4
84+
with:
85+
builder: ${{ steps.buildx.outputs.name }}
86+
cache-from: type=gha
87+
load: true
88+
tags: ${{ steps.image_name.outputs.image_name }}:test
89+
90+
# - name: Test
91+
# run: |
92+
# make _ci_test
93+
94+
- name: Build and Push
95+
uses: docker/build-push-action@v3
96+
with:
97+
builder: ${{ steps.buildx.outputs.name }}
98+
push: ${{ github.event_name != 'pull_request' }}
99+
cache-from: type=gha
100+
cache-to: type=gha,mode=max
101+
platforms: linux/amd64,linux/arm64
102+
tags: ${{ steps.meta.outputs.tags }}
103+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/dockerhub-build-push-multi-arch.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SSHD
22

3-
Minimal Alpine Linux Docker image with `sshd` exposed and `rsync` installed.
3+
Minimal Alpine Linux Docker image with `sshd` exposed and `rsync` installed. The image is available on quay.io `quay.io/panubo/sshd` and AWS ECR Public `public.ecr.aws/panubo/sshd`.
44

55
## Environment Options
66

@@ -98,7 +98,7 @@ It is strongly recommend to pre-hash passwords. Passwords that are not hashed ar
9898
To generate a hashed password use `mkpasswd` which is available in this image or use [https://trnubo.github.io/passwd.html](https://trnubo.github.io/passwd.html) to generate a hash in your browser. Example use of `mkpasswd` below.
9999

100100
```
101-
$ docker run --rm -it --entrypoint /usr/bin/env docker.io/panubo/sshd:1.4.0 mkpasswd
101+
$ docker run --rm -it --entrypoint /usr/bin/env quay.io/panubo/sshd:1.6.0 mkpasswd
102102
Password:
103103
$6$w0ZvF/gERVgv08DI$PTq73dIcZLfMK/Kxlw7rWDvVcYvnWJuOWtxC7sXAYZL69CnItCS.QM.nTUyMzaT0aYjDBdbCH1hDiwbQE8/BY1
104104
```
@@ -111,7 +111,7 @@ docker run -ti -p 2222:22 \
111111
-e SSH_USERS=user:1000:1000 \
112112
-e SSH_ENABLE_PASSWORD_AUTH=true \
113113
-v $(pwd)/entrypoint.d/:/etc/entrypoint.d/ \
114-
docker.io/panubo/sshd:1.4.0
114+
quay.io/panubo/sshd:1.6.0
115115
```
116116

117117
To enable password authentication on the root account, the previous `setpasswd.sh` script must also define a password for the root user, then
@@ -121,7 +121,7 @@ the command will be:
121121
docker run -ti -p 2222:22 \
122122
-e SSH_ENABLE_ROOT_PASSWORD_AUTH=true \
123123
-v $(pwd)/entrypoint.d/:/etc/entrypoint.d/ \
124-
docker.io/panubo/sshd:1.3.0
124+
quay.io/panubo/sshd:1.6.0
125125
```
126126

127127
## Usage Example
@@ -138,7 +138,7 @@ docker run -ti -p 2222:22 \
138138
-v $(pwd)/keys/:/etc/ssh/keys \
139139
-v $(pwd)/data/:/data/ \
140140
-e SSH_ENABLE_ROOT=true \
141-
docker.io/panubo/sshd:1.4.0
141+
quay.io/panubo/sshd:1.6.0
142142
```
143143

144144
Create a `www` user with gid/uid 48. You can access with `ssh www@localhost -p 2222` using your private key.
@@ -149,7 +149,7 @@ docker run -ti -p 2222:22 \
149149
-v $(pwd)/keys/:/etc/ssh/keys \
150150
-v $(pwd)/data/:/data/ \
151151
-e SSH_USERS="www:48:48" \
152-
docker.io/panubo/sshd:1.4.0
152+
quay.io/panubo/sshd:1.6.0
153153
```
154154

155155
## Releases

0 commit comments

Comments
 (0)