diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 15e2c06..76de575 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,16 +3,20 @@ name: Docker Image CI on: push: branches: [ "master" ] - pull_request: - branches: [ "master" ] jobs: - build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Login to GitHub Container Registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - name: Build the Docker image - run: docker build . --file Dockerfile --tag tcp-spawner:$(date +%s) + run: docker build . --file Dockerfile --tag ghcr.io/danbulant/tcp-spawner:latest + - name: Tag the docker image (date) + run: docker tag ghcr.io/danbulant/tcp-spawner:latest ghcr.io/danbulant/tcp-spawner:$(date --iso-8601) + - name: Publish the Docker image + run: docker push ghcr.io/danbulant/tcp-spawner:$(date --iso-8601) + - name: Publish the Docker image + run: docker push ghcr.io/danbulant/tcp-spawner:latest diff --git a/Dockerfile b/Dockerfile index bed7a0f..0203fae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,4 +29,7 @@ COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/tcp-sp EXPOSE 1337 +LABEL org.opencontainers.image.source=https://github.com/danbulant/ctf-tcp-server +LABEL org.opencontainers.image.description="A simple TCP process spawner written in Rust." + CMD ["tcp-spawner", "0.0.0.0:1337", "sh"] \ No newline at end of file