File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .git
2+ .gitignore
3+ README.md
4+ LICENSE
Original file line number Diff line number Diff line change 1+ name : Publish debian-bazel image
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ jobs :
10+ build-and-push :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v3
21+
22+ - name : Log in to Docker Hub
23+ uses : docker/login-action@v3
24+ with :
25+ username : ${{ secrets.DOCKERHUB_USERNAME }}
26+ password : ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+ - name : Build and push image
29+ uses : docker/build-push-action@v6
30+ with :
31+ context : .
32+ file : ./Dockerfile
33+ push : true
34+ tags : |
35+ docker.io/cartheur/debian-bazel:latest
Original file line number Diff line number Diff line change 1+ FROM debian:bullseye-slim
2+
3+ ARG BAZELISK_VERSION=v1.20.0
4+
5+ ENV DEBIAN_FRONTEND=noninteractive
6+
7+ RUN apt-get update \
8+ && apt-get install -y --no-install-recommends \
9+ ca-certificates \
10+ curl \
11+ file \
12+ git \
13+ gnupg \
14+ openjdk-17-jdk-headless \
15+ python3 \
16+ unzip \
17+ zip \
18+ build-essential \
19+ && rm -rf /var/lib/apt/lists/*
20+
21+ RUN curl -fsSL -o /usr/local/bin/bazel \
22+ "https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-linux-amd64" \
23+ && chmod +x /usr/local/bin/bazel \
24+ && ln -s /usr/local/bin/bazel /usr/local/bin/bazelisk
25+
26+ ENV BAZELISK_HOME=/usr/local/share/bazelisk
27+ WORKDIR /workspace
28+
29+ CMD ["bazel" , "--version" ]
Original file line number Diff line number Diff line change 11# debian-bazel
2- A debian bullseye image with bazelbuild available to be used for building distroless images.
2+
3+ Debian Bullseye image with Bazel available for building distroless images.
4+
5+ ## Build locally (Podman)
6+
7+ ``` bash
8+ podman build -t docker.io/cartheur/debian-bazel:latest .
9+ ```
10+
11+ ## Run locally (Podman)
12+
13+ ``` bash
14+ podman run --rm docker.io/cartheur/debian-bazel:latest
15+ ```
16+
17+ ## Push to Docker Hub (Podman)
18+
19+ ``` bash
20+ podman login docker.io
21+ podman push docker.io/cartheur/debian-bazel:latest
22+ ```
23+
24+ ## GitHub Actions auto-publish
25+
26+ Workflow file: ` .github/workflows/publish.yml `
27+
28+ Set these repository secrets in GitHub:
29+
30+ - ` DOCKERHUB_USERNAME ` : your Docker Hub username (` cartheur ` )
31+ - ` DOCKERHUB_TOKEN ` : Docker Hub access token (not your password)
32+
33+ The workflow pushes ` docker.io/cartheur/debian-bazel:latest ` on every push to ` main ` , and also supports manual run from the Actions tab.
You can’t perform that action at this time.
0 commit comments