From fb6c0dcf56d215337ab797d48bd6ffd2dbc5327f Mon Sep 17 00:00:00 2001 From: CDE90 Date: Sun, 17 Apr 2022 16:16:14 +0100 Subject: [PATCH 1/2] Add rust language --- .github/workflows/rust.yml | 43 ++++++++++++++++++++++++++++++++++++++ rust/1.31/Dockerfile | 14 +++++++++++++ rust/1.56/Dockerfile | 14 +++++++++++++ rust/1.60/Dockerfile | 14 +++++++++++++ rust/entrypoint.sh | 15 +++++++++++++ rust/latest/Dockerfile | 14 +++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 .github/workflows/rust.yml create mode 100644 rust/1.31/Dockerfile create mode 100644 rust/1.56/Dockerfile create mode 100644 rust/1.60/Dockerfile create mode 100644 rust/entrypoint.sh create mode 100644 rust/latest/Dockerfile diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..99d04f3 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,43 @@ +name: build rust +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - rust/** +jobs: + push: + name: "yolks:rust_${{ matrix.tag }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + tag: + - '1.31' + - '1.56' + - '1.60' + - 'latest' + steps: + - uses: actions/checkout@v2 + # Setup QEMU for ARM64 Build + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + with: + version: "v0.5.1" + buildkitd-flags: --debug + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + - uses: docker/build-push-action@v2 + with: + context: ./rust + file: ./rust/${{ matrix.tag }}/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/parkervcp/yolks:rust_${{ matrix.tag }} diff --git a/rust/1.31/Dockerfile b/rust/1.31/Dockerfile new file mode 100644 index 0000000..840bc9f --- /dev/null +++ b/rust/1.31/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.31-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/rust/1.56/Dockerfile b/rust/1.56/Dockerfile new file mode 100644 index 0000000..9d3bed6 --- /dev/null +++ b/rust/1.56/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.56-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/rust/1.60/Dockerfile b/rust/1.60/Dockerfile new file mode 100644 index 0000000..5624cc2 --- /dev/null +++ b/rust/1.60/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:1.60-slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/rust/entrypoint.sh b/rust/entrypoint.sh new file mode 100644 index 0000000..ed8bce1 --- /dev/null +++ b/rust/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` + +# Print current Rust version +cargo --version + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP} diff --git a/rust/latest/Dockerfile b/rust/latest/Dockerfile new file mode 100644 index 0000000..3d94aeb --- /dev/null +++ b/rust/latest/Dockerfile @@ -0,0 +1,14 @@ +FROM --platform=$TARGETOS/$TARGETARCH rust:slim + +LABEL author="Ethan Coward" maintainer="ethan.coward@icloud.com" + +RUN apt update \ + && apt -y install git dnsutils curl iproute2 ffmpeg \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container CARGO_HOME=/home/container/.cargo +WORKDIR /home/container + +COPY ./../entrypoint.sh /entrypoint.sh +CMD ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file From e889a1e143ea512a90da7c0e5f4eee86b8f6a565 Mon Sep 17 00:00:00 2001 From: CDE90 Date: Sun, 17 Apr 2022 16:19:55 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 9d54cf5..59361ca 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,17 @@ is tagged correctly. * [`Redis 6`](/redis/6) * `ghcr.io/parkervcp/yolks:redis_6` +### [Rust](/rust) + +* ['rust1.31'](/rust/1.31) + * `ghcr.io/parkervcp/yolks:rust_1.31` +* ['rust1.56'](/rust/1.56) + * `ghcr.io/parkervcp/yolks:rust_1.56` +* ['rust1.60'](/rust/1.60) + * `ghcr.io/parkervcp/yolks:rust_1.60` +* ['rust latest'](/rust/latest) + * `ghcr.io/parkervcp/yolks:rust_latest` + ### [Voice](/voice) * [`TeaSpeak`](/teaspeak)