Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ env:
DOCKER_MIRROR_REGISTRY_PASSWORD: ${{ secrets.DOCKER_MIRROR_REGISTRY_PASSWORD }}

jobs:
job-k3s-ctk:
name: 'k3s-ctk'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image k3s-ctk latest docker_k8s/k3s-ctk.Dockerfile && push_image

job-k0s-ctk:
name: 'k0s-ctk'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image k0s-ctk latest docker_k8s/k0s-ctk.Dockerfile && push_image


## Sync all images in this build (listed by "names") to mirror registry.
sync_images:
needs: []
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ lib64/
parts/
sdist/
var/
tmp/
*.egg-info/
.installed.cfg
*.egg
Expand Down
9 changes: 9 additions & 0 deletions docker_k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# k8s reload images

## k3s

Air-gap Install: https://docs.k3s.io/installation/airgap

## k0s

Air-gap Install: https://docs.k0sproject.io/head/airgap-install/
22 changes: 22 additions & 0 deletions docker_k8s/k0s-ctk.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Distributed under the terms of the Modified BSD License.

ARG BASE_NAMESPACE
ARG BASE_IMG="atom"
FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG} AS runner

LABEL maintainer="haobibo@gmail.com"

COPY work /opt/utils/

RUN set -eux \
&& source /opt/utils/script-setup-k8s-common.sh && setup_kubectl && setup_helm \
&& source /opt/utils/script-setup-k0s.sh && setup_k0s && setup_k0s_pack \
&& mv /opt/utils/script-setup-k0s.sh /opt/k0s/ \
&& mv /opt/k8s/* /opt/k0s/ && rm -rf /opt/k8s \
&& ls -alh /opt/*


FROM docker.io/busybox
COPY --from=runner /opt/k0s /opt/k0s
LABEL usage="docker run --rm -it -v /opt/k0s:/tmp k0s"
CMD ["sh", "-c", "ls -alh /opt/k0s && cp -rf /opt/k0s/* /tmp/"]
22 changes: 22 additions & 0 deletions docker_k8s/k3s-ctk.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Distributed under the terms of the Modified BSD License.

ARG BASE_NAMESPACE
ARG BASE_IMG="atom"
FROM ${BASE_NAMESPACE:+$BASE_NAMESPACE/}${BASE_IMG} AS runner

LABEL maintainer="haobibo@gmail.com"

COPY work /opt/utils/

RUN set -eux \
&& source /opt/utils/script-setup-k8s-common.sh && setup_kubectl && setup_helm \
&& source /opt/utils/script-setup-k3s.sh && setup_k3s && setup_cri_dockerd && setup_k3s_pack \
&& mv /opt/utils/script-setup-k3s.sh /opt/k3s/ \
&& mv /opt/k8s/* /opt/k3s/ && rm -rf /opt/k8s \
&& ls -alh /opt/*


FROM docker.io/busybox
COPY --from=runner /opt/k3s /opt/k3s
LABEL usage="docker run --rm -it -v /opt/k3s/:/tmp/ k3s"
CMD ["sh", "-c", "ls -alh /opt/k3s && cp -rf /opt/k3s/* /tmp/"]
Loading
Loading