-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from junkurihara/develop
Closes #57 Release 0.5.0
- Loading branch information
Showing
29 changed files
with
703 additions
and
310 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 |
---|---|---|
@@ -1,103 +1,127 @@ | ||
name: Build and Publish Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- "develop" | ||
- "main" | ||
pull_request: | ||
types: [synchronize, opened] | ||
|
||
env: | ||
REGISTRY_IMAGE: jqtype/rpxy | ||
GHCR: ghcr.io | ||
GHCR_IMAGE_NAME: ${{ github.repository }} | ||
DH_REGISTRY_NAME: jqtype/rpxy | ||
|
||
jobs: | ||
build_and_push: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: "default" | ||
dockerfile: ./docker/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- target: "default-slim" | ||
dockerfile: ./docker/Dockerfile-slim | ||
build-contexts: | | ||
messense/rust-musl-cross:amd64-musl=docker-image://messense/rust-musl-cross:x86_64-musl | ||
messense/rust-musl-cross:arm64-musl=docker-image://messense/rust-musl-cross:aarch64-musl | ||
platforms: linux/amd64,linux/arm64 | ||
tags-suffix: "-slim" | ||
# Aliases must be used only for release builds | ||
aliases: | | ||
"slim" | ||
- target: "s2n" | ||
dockerfile: ./docker/Dockerfile | ||
build-args: | | ||
"CARGO_FEATURES=--no-default-features --features http3-s2n" | ||
"ADDITIONAL_DEPS=pkg-config libssl-dev cmake libclang1 gcc g++" | ||
platforms: linux/amd64,linux/arm64 | ||
tags-suffix: "-s2n" | ||
# Aliases must be used only for release builds | ||
aliases: | | ||
"s2n" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: GitHub Environment | ||
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY_IMAGE }} | ||
images: ${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.GHCR }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Release build and push | ||
if: ${{ env.BRANCH == 'main' }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY_IMAGE }}:latest | ||
file: ./docker/Dockerfile | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Release build and push slim | ||
if: ${{ env.BRANCH == 'main' }} | ||
- name: Nightly build test on amd64 for pull requests | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY_IMAGE }}:slim, ${{ env.REGISTRY_IMAGE }}:latest-slim | ||
build-contexts: | | ||
messense/rust-musl-cross:amd64-musl=docker-image://messense/rust-musl-cross:x86_64-musl | ||
messense/rust-musl-cross:arm64-musl=docker-image://messense/rust-musl-cross:aarch64-musl | ||
file: ./docker/Dockerfile.slim | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
build-args: ${{ matrix.build-args }} | ||
push: false | ||
build-contexts: ${{ matrix.build-contexts }} | ||
file: ${{ matrix.dockerfile }} | ||
cache-from: type=gha,scope=rpxy-nightly-${{ matrix.target }} | ||
cache-to: type=gha,mode=max,scope=rpxy-nightly-${{ matrix.target }} | ||
platforms: linux/amd64 | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Nightly build and push | ||
if: ${{ env.BRANCH == 'develop' }} | ||
- name: Nightly build and push from develop branch | ||
if: ${{ (github.ref_name == 'develop') && (github.event_name == 'push') }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
build-args: ${{ matrix.build-args }} | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY_IMAGE }}:nightly | ||
file: ./docker/Dockerfile | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:nightly${{ matrix.tags-suffix }} | ||
${{ env.DH_REGISTRY_NAME }}:nightly${{ matrix.tags-suffix }} | ||
build-contexts: ${{ matrix.build-contexts }} | ||
file: ${{ matrix.dockerfile }} | ||
cache-from: type=gha,scope=rpxy-nightly-${{ matrix.target }} | ||
cache-to: type=gha,mode=max,scope=rpxy-nightly-${{ matrix.target }} | ||
platforms: ${{ matrix.platforms }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Nightly build and push slim | ||
if: ${{ env.BRANCH == 'develop' }} | ||
- name: Release build and push from main branch | ||
if: ${{ (github.ref_name == 'main') && (github.event_name == 'push') }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
build-args: ${{ matrix.build-args }} | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY_IMAGE }}:nightly-slim | ||
build-contexts: | | ||
messense/rust-musl-cross:amd64-musl=docker-image://messense/rust-musl-cross:x86_64-musl | ||
messense/rust-musl-cross:arm64-musl=docker-image://messense/rust-musl-cross:aarch64-musl | ||
file: ./docker/Dockerfile.slim | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:latest${{ matrix.tags-suffix }} | ||
${{ env.DH_REGISTRY_NAME }}:latest${{ matrix.tags-suffix }} | ||
${{ env.GHCR }}/${{ env.GHCR_IMAGE_NAME }}:${{ matrix.aliases }} | ||
${{ env.DH_REGISTRY_NAME }}:${{ matrix.aliases }} | ||
build-contexts: ${{ matrix.build-contexts }} | ||
file: ${{ matrix.dockerfile }} | ||
cache-from: type=gha,scope=rpxy-latest-${{ matrix.target }} | ||
cache-to: type=gha,mode=max,scope=rpxy-latest-${{ matrix.target }} | ||
platforms: ${{ matrix.platforms }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
[submodule "quinn"] | ||
path = quinn | ||
url = [email protected]:junkurihara/quinn.git | ||
[submodule "s2n-quic"] | ||
path = s2n-quic | ||
url = [email protected]:junkurihara/s2n-quic.git |
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
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
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
File renamed without changes.
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 @@ | ||
# Docker Images of `rpxy` | ||
|
||
The `rpxy` docker images are hosted both on [Docker Hub](https://hub.docker.com/r/jqtype/rpxy) and [GitHub Container Registry](https://github.com/junkurihara/rust-rpxy/pkgs/container/rust-rpxy). Differences among tags are summarized as follows. | ||
|
||
## Latest Builds | ||
|
||
- `latest`: Built from the `main` branch with default features, running on Ubuntu. | ||
- `latest-slim`, `slim`: Built by `musl` from the `main` branch with default features, running on Alpine. | ||
- `latest-s2n`, `s2n`: Built from the `main` branch with the `http3-s2n` feature, running on Ubuntu. | ||
|
||
## Nightly Builds | ||
|
||
- `nightly`: Built from the `develop` branch with default features, running on Ubuntu. | ||
- `nightly-slim`: Built by `musl` from the `develop` branch with default features, running on Alpine. | ||
- `nightly-s2n`: Built from the `develop` branch with the `http3-s2n` feature, running on Ubuntu. | ||
|
||
## Caveats | ||
|
||
Due to some compile errors of `s2n-quic` subpackages with `musl`, `nightly-s2n-slim` or `latest-s2n-slim` are not yet provided. |
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,34 @@ | ||
version: "3" | ||
services: | ||
rpxy-rp: | ||
image: jqtype/rpxy:slim # ghcr.io/junkurihara/rust-rpxy:slim also works | ||
container_name: rpxy | ||
init: true | ||
restart: unless-stopped | ||
ports: | ||
- 127.0.0.1:8080:8080/tcp | ||
- 127.0.0.1:8443:8443/udp | ||
- 127.0.0.1:8443:8443/tcp | ||
# build: # Uncomment if you build yourself | ||
# context: ../ | ||
# additional_contexts: | ||
# - messense/rust-musl-cross:amd64-musl=docker-image://messense/rust-musl-cross:x86_64-musl | ||
# - messense/rust-musl-cross:arm64-musl=docker-image://messense/rust-musl-cross:aarch64-musl | ||
# dockerfile: ./docker/Dockerfile-slim # based on alpine and build x86_64-unknown-linux-musl | ||
# platforms: # Choose your platforms | ||
# - "linux/amd64" | ||
# # - "linux/arm64" | ||
environment: | ||
- LOG_LEVEL=debug | ||
- LOG_TO_FILE=true | ||
- HOST_USER=jun | ||
- HOST_UID=501 | ||
- HOST_GID=501 | ||
# - WATCH=true | ||
tty: false | ||
privileged: true | ||
volumes: | ||
- ./log:/rpxy/log | ||
- ../example-certs/server.crt:/certs/server.crt:ro | ||
- ../example-certs/server.key:/certs/server.key:ro | ||
- ../config-example.toml:/etc/rpxy.toml:ro |
Oops, something went wrong.