Paper-Dragon
12 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
32 additions and
3 deletions
.github/workflows/publish-docker.yml
Dockerfile.alpine
Dockerfile.ubuntu
README.md
@ -50,11 +50,22 @@ jobs:
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name : Build and push Docker image
- name : Build gnu and push Docker image
uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
platforms : linux/amd64,linux/arm64
context : .
file : Dockerfile.ubuntu
push : true
tags : ${{ steps.meta.outputs.tags }}
tags : ${{ steps.meta.outputs.tags }}-ubuntu
labels : ${{ steps.meta.outputs.labels }}
- name : Build musl and push Docker image
uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
platforms : linux/amd64
context : .
file : Dockerfile.alpine
push : true
tags : ${{ steps.meta.outputs.tags }}-alpine
labels : ${{ steps.meta.outputs.labels }}
@ -0,0 +1,18 @@
####################################################################################################
## Builder
####################################################################################################
FROM rust:latest AS builder
WORKDIR /worker
COPY ./ .
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --release --target x86_64-unknown-linux-musl
####################################################################################################
## Final image
####################################################################################################
FROM alpine:latest
RUN apk add --no-cache iproute2
COPY --from=builder /worker/target/x86_64-unknown-linux-musl/release/tun2proxy-bin /usr/bin/tun2proxy-bin
ENTRYPOINT ["/usr/bin/tun2proxy-bin", "--setup"]
@ -212,7 +212,7 @@ services:
cap_add:
- NET_ADMIN
container_name: tun2proxy
image: ghcr.io/tun2proxy/tun2proxy:latest
image: ghcr.io/tun2proxy/tun2proxy:latest-ubuntu
command: --proxy proto://[username[:password]@]host:port
alpine:
stdin_open: true