Skip to content

Commit e87182b

Browse files
committed
use bitnami golang image for tools
Curl for example was included. can't use official golang image for now.
1 parent 50754a4 commit e87182b

8 files changed

Lines changed: 186 additions & 1 deletion

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: B&R dep Bitnami golang
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'external/bitnami-deprecated-golang/1.25/debian-12/**'
8+
- '.github/workflows/release-bitnami-golang.yml'
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Extract Docker metadata
24+
id: meta
25+
uses: docker/metadata-action@v3
26+
with:
27+
images: ghcr.io/${{ github.repository }}/bitnami-deprecated-golang
28+
tags: |
29+
type=raw,value=1.25-debian-12
30+
31+
- name: Log in to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Build and push Docker image
39+
uses: docker/build-push-action@v6
40+
with:
41+
context: external/bitnami-deprecated-golang/1.25/debian-12
42+
file: external/bitnami-deprecated-golang/1.25/debian-12/Dockerfile
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}

cmd/kubeapps-apis/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# syntax = docker/dockerfile:1
55

6-
FROM golang:1.25.1-alpine3.22 AS builder
6+
FROM ghcr.io/sap/kubeapps/bitnami-deprecated-golang:1.25-debian-12 AS builder
77
WORKDIR /go/src/github.com/vmware-tanzu/kubeapps
88
COPY go.mod go.sum ./
99
ARG VERSION="devel"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright Broadcom, Inc. All Rights Reserved.
2+
# SPDX-License-Identifier: APACHE-2.0
3+
4+
FROM docker.io/bitnami/minideb:bookworm
5+
6+
ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith"
7+
ARG TARGETARCH
8+
9+
LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
10+
org.opencontainers.image.created="2025-09-23T18:48:44Z" \
11+
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
12+
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/golang/README.md" \
13+
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/golang" \
14+
org.opencontainers.image.title="golang" \
15+
org.opencontainers.image.vendor="Broadcom, Inc." \
16+
org.opencontainers.image.version="1.25.1"
17+
18+
ENV OS_ARCH="${TARGETARCH:-amd64}" \
19+
OS_FLAVOUR="debian-12" \
20+
OS_NAME="linux"
21+
22+
COPY prebuildfs /
23+
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
24+
# Install required system packages and dependencies
25+
RUN install_packages build-essential ca-certificates curl git pkg-config procps unzip
26+
RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
27+
DOWNLOADS_URL=${SECRET_DOWNLOADS_URL:-${DOWNLOADS_URL}} ; \
28+
mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
29+
COMPONENTS=( \
30+
"golang-1.25.1-0-linux-${OS_ARCH}-debian-12" \
31+
) ; \
32+
for COMPONENT in "${COMPONENTS[@]}"; do \
33+
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
34+
curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz" -O ; \
35+
curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz.sha256" -O ; \
36+
fi ; \
37+
sha256sum -c "${COMPONENT}.tar.gz.sha256" ; \
38+
tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner ; \
39+
rm -rf "${COMPONENT}".tar.gz{,.sha256} ; \
40+
done
41+
RUN apt-get update && apt-get upgrade -y && \
42+
apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
43+
RUN find / -perm /6000 -type f -exec chmod a-s {} \; || true
44+
RUN mkdir -p "/go/src" "/go/bin" && chmod -R 777 "/go"
45+
46+
ENV APP_VERSION="1.25.1" \
47+
BITNAMI_APP_NAME="golang" \
48+
GOCACHE="/go/.cache" \
49+
GOPATH="/go" \
50+
IMAGE_REVISION="2" \
51+
PATH="/go/bin:/opt/bitnami/go/bin:$PATH"
52+
53+
WORKDIR $GOPATH
54+
CMD [ "bash" ]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright Broadcom, Inc. All Rights Reserved.
2+
# SPDX-License-Identifier: APACHE-2.0
3+
4+
services:
5+
golang:
6+
tty: true # Enables debugging capabilities when attached to this container.
7+
image: docker.io/bitnami/golang:1.25
8+
command: ["sleep", "infinity"] # To keep the container running
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Bitnami containers ship with software bundles. You can find the licenses under:
2+
/opt/bitnami/[name-of-bundle]/licenses/[bundle-version].txt
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
# Copyright Broadcom, Inc. All Rights Reserved.
3+
# SPDX-License-Identifier: APACHE-2.0
4+
set -eu
5+
6+
n=0
7+
max=2
8+
export DEBIAN_FRONTEND=noninteractive
9+
10+
until [ $n -gt $max ]; do
11+
set +e
12+
(
13+
apt-get update -qq &&
14+
apt-get install -y --no-install-recommends "$@"
15+
)
16+
CODE=$?
17+
set -e
18+
if [ $CODE -eq 0 ]; then
19+
break
20+
fi
21+
if [ $n -eq $max ]; then
22+
exit $CODE
23+
fi
24+
echo "apt failed, retrying"
25+
n=$(($n + 1))
26+
done
27+
apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
# Copyright Broadcom, Inc. All Rights Reserved.
3+
# SPDX-License-Identifier: APACHE-2.0
4+
set -u
5+
6+
if [ $# -eq 0 ]; then
7+
>&2 echo "No arguments provided"
8+
exit 1
9+
fi
10+
11+
script=$1
12+
exit_code="${2:-96}"
13+
fail_if_not_present="${3:-n}"
14+
15+
if test -f "$script"; then
16+
sh $script
17+
18+
if [ $? -ne 0 ]; then
19+
exit $((exit_code))
20+
fi
21+
elif [ "$fail_if_not_present" = "y" ]; then
22+
>&2 echo "script not found: $script"
23+
exit 127
24+
fi
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
# Copyright Broadcom, Inc. All Rights Reserved.
3+
# SPDX-License-Identifier: APACHE-2.0
4+
set -eu
5+
6+
n=0
7+
max=2
8+
export DEBIAN_FRONTEND=noninteractive
9+
10+
until [ $n -gt $max ]; do
11+
set +e
12+
(
13+
apt-get autoremove --purge -y "$@"
14+
)
15+
CODE=$?
16+
set -e
17+
if [ $CODE -eq 0 ]; then
18+
break
19+
fi
20+
if [ $n -eq $max ]; then
21+
exit $CODE
22+
fi
23+
echo "apt failed, retrying"
24+
n=$(($n + 1))
25+
done
26+
apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives

0 commit comments

Comments
 (0)