diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml new file mode 100644 index 0000000..789a818 --- /dev/null +++ b/.github/workflows/docker-build.yaml @@ -0,0 +1,22 @@ +name: Build + +on: + push: + branches: + - '!main' + pull_request: { } + +jobs: + docker: + name: Docker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Build + uses: docker/build-push-action@v1 + with: + registry: containers.monetr.dev + repository: twemproxy + push: false diff --git a/.github/workflows/docker-push.yaml b/.github/workflows/docker-push.yaml new file mode 100644 index 0000000..8b78336 --- /dev/null +++ b/.github/workflows/docker-push.yaml @@ -0,0 +1,35 @@ +name: Publish + +on: + push: + branches: + - main + +jobs: + docker: + name: Docker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Generate Tag + id: tag + run: | + echo ::set-output name=POST_TAG::$(date +%Y.%m.%d) + - name: Build and push containers.monetr.dev + uses: docker/build-push-action@v1 + with: + registry: containers.monetr.dev + username: ${{ secrets.containers_push_username }} + password: ${{ secrets.containers_push_password }} + tags: latest,${{ steps.tag.outputs.POST_TAG }} + repository: twemproxy + - name: Build and push ghcr.io + uses: docker/build-push-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + tags: latest,${{ steps.tag.outputs.POST_TAG }} + repository: monetr/twemproxy diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2866bd5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "twemproxy"] + path = twemproxy + url = https://github.com/twitter/twemproxy.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b4e229a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM gcc:9.4.0 + +COPY ./twemproxy /usr/src/twemproxy +WORKDIR /usr/src/twemproxy +RUN \ + autoreconf -h && \ + autoreconf -fvi && \ + ./configure && \ + make && \ + make install + +FROM debian:bullseye + +COPY --from=builder /usr/local/sbin/nutcracker /bin/nutcracker + +ENTRYPOINT [ "nutcracker" ] diff --git a/twemproxy b/twemproxy new file mode 160000 index 0000000..1fde0f4 --- /dev/null +++ b/twemproxy @@ -0,0 +1 @@ +Subproject commit 1fde0f4717823fabdd01cdb664f69b70aa8298c7