docker: push images to GHCR too

use numeric id for user inside Dockerfile
This commit is contained in:
Nicola Murino 2020-10-18 19:18:51 +02:00
parent 1625cd5a9f
commit d812c86812
No known key found for this signature in database
GPG key ID: 2F1FB59433D5A8CB
4 changed files with 19 additions and 6 deletions

View file

@ -18,7 +18,12 @@ jobs:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
docker_pkg: [debian, alpine] docker_pkg:
- debian
- alpine
docker_image:
- drakkan/sftpgo
- ghcr.io/drakkan/sftpgo
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -34,7 +39,6 @@ jobs:
- name: Gather image information - name: Gather image information
id: info id: info
run: | run: |
DOCKER_IMAGE=drakkan/sftpgo
VERSION=noop VERSION=noop
DOCKERFILE=Dockerfile DOCKERFILE=Dockerfile
MINOR="" MINOR=""
@ -80,6 +84,7 @@ jobs:
echo ::set-output name=sha::${GITHUB_SHA::8} echo ::set-output name=sha::${GITHUB_SHA::8}
env: env:
DOCKER_PKG: ${{ matrix.docker_pkg }} DOCKER_PKG: ${{ matrix.docker_pkg }}
DOCKER_IMAGE: ${{ matrix.docker_image }}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
@ -92,7 +97,15 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
if: github.event_name != 'pull_request' if: ${{ github.event_name != 'pull_request' && matrix.docker_image == 'drakkan/sftpgo' }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
if: ${{ github.event_name != 'pull_request' && matrix.docker_image == 'ghcr.io/drakkan/sftpgo' }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2

View file

@ -60,7 +60,7 @@ RUN chown -R sftpgo:sftpgo /etc/sftpgo && chown sftpgo:sftpgo /var/lib/sftpgo /s
chmod 750 /etc/sftpgo /var/lib/sftpgo /srv/sftpgo chmod 750 /etc/sftpgo /var/lib/sftpgo /srv/sftpgo
WORKDIR /var/lib/sftpgo WORKDIR /var/lib/sftpgo
USER sftpgo USER 1000:1000
VOLUME [ "/var/lib/sftpgo", "/srv/sftpgo" ] VOLUME [ "/var/lib/sftpgo", "/srv/sftpgo" ]

View file

@ -65,7 +65,7 @@ RUN chown -R sftpgo:sftpgo /etc/sftpgo && chown sftpgo:sftpgo /var/lib/sftpgo /s
chmod 750 /etc/sftpgo /var/lib/sftpgo /srv/sftpgo chmod 750 /etc/sftpgo /var/lib/sftpgo /srv/sftpgo
WORKDIR /var/lib/sftpgo WORKDIR /var/lib/sftpgo
USER sftpgo USER 1000:1000
VOLUME [ "/var/lib/sftpgo", "/srv/sftpgo" ] VOLUME [ "/var/lib/sftpgo", "/srv/sftpgo" ]

View file

@ -1,6 +1,6 @@
# Official Docker image # Official Docker image
SFTPGo provides an official Docker image, it is available on [Docker Hub](https://hub.docker.com/r/drakkan/sftpgo). SFTPGo provides an official Docker image, it is available on both [Docker Hub](https://hub.docker.com/r/drakkan/sftpgo) and on [GitHub Container Registry](https://github.com/users/drakkan/packages/container/package/sftpgo).
## Supported tags and respective Dockerfile links ## Supported tags and respective Dockerfile links