Skip to content

Commit

Permalink
Test build for #2060
Browse files Browse the repository at this point in the history
  • Loading branch information
SUSE Update Bot committed Dec 6, 2024
1 parent 6db7512 commit 4fbad8f
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ staging_build:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: kiwi-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: kubectl-image
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
- branch_package:
source_project: home:defolos:BCI:CR:Tumbleweed
source_package: mariadb-image
Expand Down Expand Up @@ -331,6 +335,9 @@ refresh_devel_BCI:
- trigger_services:
project: devel:BCI:Tumbleweed
package: kiwi-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: kubectl-image
- trigger_services:
project: devel:BCI:Tumbleweed
package: mariadb-image
Expand Down
55 changes: 55 additions & 0 deletions kubectl-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SPDX-License-Identifier: Apache-2.0

# Copyright (c) 2024 SUSE LLC

# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon.

# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
# It is maintained by the BCI team and generated by
# https://github.com/SUSE/BCI-dockerfile-generator

# Please submit bugfixes or comments via https://bugs.opensuse.org/
# You can contact the BCI team via https://github.com/SUSE/bci/discussions

#!UseOBSRepositories

#!BuildTag: opensuse/kubectl:%%kubectl_version%%-%RELEASE%
#!BuildTag: opensuse/kubectl:%%kubectl_version%%
#!BuildTag: opensuse/kubectl:1.31
#!BuildTag: opensuse/kubectl:1
#!BuildTag: opensuse/kubectl:latest

FROM opensuse/bci/bci-micro:latest AS target
FROM opensuse/tumbleweed:latest AS builder
COPY --from=target / /target

RUN set -euo pipefail; \
zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends kubernetes1.31-client; \
zypper -n clean; \
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}
# sanity check that the version from the tag is equal to the version of kubernetes1.31-client that we expect
RUN set -euo pipefail; \
[ "$(rpm --root /target -q --qf '%{version}' kubernetes1.31-client | \
cut -d '.' -f -3)" = "1.31.3" ]
FROM opensuse/bci/bci-micro:latest
COPY --from=builder /target /
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=org.opensuse.application.kubectl
LABEL org.opencontainers.image.title="openSUSE Tumbleweed kubectl"
LABEL org.opencontainers.image.description="Kuberneted CLI for communicating with a Kubernetes cluster's control plane, using the Kubernetes API."
LABEL org.opencontainers.image.version="%%kubectl_version%%"
LABEL org.opencontainers.image.url="https://www.opensuse.org"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="openSUSE Project"
LABEL org.opencontainers.image.source="%SOURCEURL%"
LABEL org.opencontainers.image.ref.name="%%kubectl_version%%-%RELEASE%"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/kubectl:%%kubectl_version%%-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI"
LABEL org.opensuse.release-stage="released"
# endlabelprefix
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/kubectl-image/README.md"
LABEL io.artifacthub.package.logo-url="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png"
ENTRYPOINT ["kubectl"]
32 changes: 32 additions & 0 deletions kubectl-image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# kubectl Container Image

![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)

Kubectl is a command line tool for communicating with a Kubernetes cluster's control plane, using the Kubernetes API.

## How to use this Container Image

To run commands inside the container for the current k8s cluster for which the kubeconfig is available in `/root/.kube.config`:

```ShellSession
podman run --rm --name kubectl\
registry.opensuse.org/opensuse/kubectl:1.31 get nodes
```

To pass configuration of a remote k8s cluster to the container:

```ShellSession
podman run --rm --name kubectl\
-v /localpath/to/kubeconfig:/root/.kube/config
registry.opensuse.org/opensuse/kubectl:1.31 get nodes
```

## Licensing

`SPDX-License-Identifier: Apache-2.0`

This documentation and the build recipe are licensed as Apache-2.0.
The container itself contains various software components under various open source licenses listed in the associated
Software Bill of Materials (SBOM).

This image is based on [openSUSE Tumbleweed](https://get.opensuse.org/tumbleweed/).
10 changes: 10 additions & 0 deletions kubectl-image/_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<services>
<service mode="buildtime" name="docker_label_helper"/>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service mode="buildtime" name="replace_using_package_version">
<param name="file">Dockerfile</param>
<param name="regex">%%kubectl_version%%</param>
<param name="package">kubernetes1.31-client</param>
<param name="parse-version">patch</param>
</service>
</services>
4 changes: 4 additions & 0 deletions kubectl-image/kubectl-image.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Fri Dec 06 06:03:27 UTC 2024 - SUSE Update Bot <[email protected]>

- First version of the kubectl BCI

0 comments on commit 4fbad8f

Please sign in to comment.