From 5566a60040d6cbaf6a75c0eff4ca723c50ce77a2 Mon Sep 17 00:00:00 2001 From: Nite07 Date: Sun, 6 Oct 2024 19:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-dev-env.yml | 31 +++++++++++++++++++ .github/workflows/docker-tailscale-derper.yml | 2 +- Dockerfile-dev-env.dockerfile | 29 +++++++++++++++++ ... => Dockerfile-tailscale-derper.dockerfile | 0 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker-dev-env.yml create mode 100644 Dockerfile-dev-env.dockerfile rename Dockerfile-tailscale-derper => Dockerfile-tailscale-derper.dockerfile (100%) diff --git a/.github/workflows/docker-dev-env.yml b/.github/workflows/docker-dev-env.yml new file mode 100644 index 0000000..a63a2bf --- /dev/null +++ b/.github/workflows/docker-dev-env.yml @@ -0,0 +1,31 @@ +name: docker-dev-env + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: nite07/dev-env:latest + platforms: linux/amd64 + file: ./Dockerfile-dev-env.dockerfile diff --git a/.github/workflows/docker-tailscale-derper.yml b/.github/workflows/docker-tailscale-derper.yml index e4b0050..1858f78 100644 --- a/.github/workflows/docker-tailscale-derper.yml +++ b/.github/workflows/docker-tailscale-derper.yml @@ -30,4 +30,4 @@ jobs: push: true tags: nite07/tailscale-derp-docker:latest platforms: linux/amd64,linux/arm64,linux/arm/v7 - file: ./Dockerfile-tailscale-derper + file: ./Dockerfile-tailscale-derper.dockerfile diff --git a/Dockerfile-dev-env.dockerfile b/Dockerfile-dev-env.dockerfile new file mode 100644 index 0000000..da2138b --- /dev/null +++ b/Dockerfile-dev-env.dockerfile @@ -0,0 +1,29 @@ +FROM debian:12 + +RUN apt-get update && apt-get install -y \ + curl \ + git \ + vim \ + wget \ + unzip \ + make \ + gcc \ + build-essential + +ENV GO_VERSION=1.23.2 +RUN curl -OL https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz +RUN tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz +RUN rm go${GO_VERSION}.linux-amd64.tar.gz + +ENV PATH=$PATH:/usr/local/go/bin +ENV GOPATH=/go +ENV PATH=$PATH:$GOPATH/bin + +WORKDIR /workspace + +RUN go install github.com/go-delve/delve/cmd/dlv@latest +RUN go install golang.org/x/tools/gopls@latest +RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +RUN go install github.com/goreleaser/goreleaser/v2@latest + +CMD ["bash"] diff --git a/Dockerfile-tailscale-derper b/Dockerfile-tailscale-derper.dockerfile similarity index 100% rename from Dockerfile-tailscale-derper rename to Dockerfile-tailscale-derper.dockerfile