Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Amin Vakil 2022-02-25 13:57:58 +03:30
commit 241c8488c0
No known key found for this signature in database
GPG key ID: 1EFC1864E9D9E56B
2 changed files with 87 additions and 1 deletions

View file

@ -0,0 +1,86 @@
name: Docker hub auto publish image
on:
push:
branches:
- master
paths:
# Run when file is edited
- Dockerfile
- start_vsftpd.sh
- vsftpd.conf
# Run tests for any PRs.
pull_request:
env:
# Image name at docker hub
IMAGE_NAME: delfer/alpine-ftp-server
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
push:
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
# Genrate secret from here https://hub.docker.com/settings/security
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Add Label Schema to Dockerfile
run: |
# Label Schema based on http://label-schema.org/rc1/
TIME_ISO=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "LABEL org.label-schema.build-date=$TIME_ISO" >> Dockerfile
echo "LABEL org.label-schema.name=vsftpd" >> Dockerfile
echo "LABEL org.label-schema.url=https://security.appspot.com/vsftpd.html" >> Dockerfile
echo "LABEL org.label-schema.vcs-url=https://github.com/delfer/docker-alpine-ftp-server" >> Dockerfile
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
echo "LABEL org.label-schema.vcs-ref=$GIT_HASH" >> Dockerfile
echo "LABEL org.label-schema.schema-version=1.0.0-rc.1" >> Dockerfile
echo "LABEL org.label-schema.docker.cmd=\"docker run -d -p 21:21 -e USERS=\"username|password\" delfer/alpine-ftp-server\"" >> Dockerfile
# Show edited Dockerfile content
cat Dockerfile
- name: Build and push latest
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:latest

View file

@ -16,7 +16,7 @@ docker run -d \
Environment variables:
- `USERS` - space and `|` separated list (optional, default: `ftp|alpineftp`)
- format `name1|password1|[folder1][|uid1] name2|password2|[folder2][|uid2]`
- `ADDRESS` - external address witch clients can connect passive ports (optional)
- `ADDRESS` - external address witch clients can connect passive ports (optional, should resolve to ftp server ip address)
- `MIN_PORT` - minimum port number to be used for passive connections (optional, default `21000`)
- `MAX_PORT` - maximum port number to be used for passive connections (optional, default `21010`)