mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-18 15:15:22 +00:00
build image based on alpine/musl (#212)
Some checks failed
Push or PR / build_n_test (macos-latest) (push) Has been cancelled
Push or PR / build_n_test (ubuntu-latest) (push) Has been cancelled
Push or PR / build_n_test (windows-latest) (push) Has been cancelled
Push or PR / build_n_test_android (push) Has been cancelled
Push or PR / build_n_test_ios (push) Has been cancelled
Push or PR / Check semver (push) Has been cancelled
Integration Tests / Proxy Tests (push) Has been cancelled
Some checks failed
Push or PR / build_n_test (macos-latest) (push) Has been cancelled
Push or PR / build_n_test (ubuntu-latest) (push) Has been cancelled
Push or PR / build_n_test (windows-latest) (push) Has been cancelled
Push or PR / build_n_test_android (push) Has been cancelled
Push or PR / build_n_test_ios (push) Has been cancelled
Push or PR / Check semver (push) Has been cancelled
Integration Tests / Proxy Tests (push) Has been cancelled
This commit is contained in:
parent
fbc47a3001
commit
8b4ecabd8f
4 changed files with 32 additions and 3 deletions
15
.github/workflows/publish-docker.yml
vendored
15
.github/workflows/publish-docker.yml
vendored
|
@ -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.
|
# 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 `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.
|
# 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
|
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
context: .
|
context: .
|
||||||
|
file: Dockerfile.ubuntu
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}-ubuntu
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
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 }}
|
18
Dockerfile.alpine
Normal file
18
Dockerfile.alpine
Normal file
|
@ -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:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
container_name: tun2proxy
|
container_name: tun2proxy
|
||||||
image: ghcr.io/tun2proxy/tun2proxy:latest
|
image: ghcr.io/tun2proxy/tun2proxy:latest-ubuntu
|
||||||
command: --proxy proto://[username[:password]@]host:port
|
command: --proxy proto://[username[:password]@]host:port
|
||||||
alpine:
|
alpine:
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue