Sign inSign up

djieno/alpine-k3s

By djieno

•Updated over 7 years ago

Image
0

130

djieno/alpine-k3s repository overview

This docker image is based on the standard Alpine image with additional k3s installed. This way it's easy to use it as a gitlab runner task to be able to dockers and manifest by using k3s in your (Gitlab) pipeline.

⁠Dockerfile

user@server:~/repos/alpine-curl-kubectl$ cat Dockerfile.amd64 
FROM alpine:latest
RUN apk add --no-cache --update curl

RUN VERSION=$(curl -w "%{url_effective}" -I -L -s -S https://github.com/rancher/k3s/releases/latest -o /dev/null | sed -e "s|.*/||") \
	BINURL=https://github.com/rancher/k3s/releases/download/${VERSION}/k3s \
	&& curl -o /usr/local/bin/k3s -sfL $BINURL \ 
	&& chmod 755 /usr/local/bin/k3s \
	&& ln -s /usr/local/bin/k3s /usr/local/bin/kubectl
	 
RUN apk del curl

⁠Below a snipped of a .gitlab-ci.yml stage

tb_k8s:
  stage: test_build
  image: djieno/alpine-k3s:amd64
  tags:
    - kubernetes
  script:
    - kubectl --kubeconfig ./kubeconfig.yaml get node
    - echo "some test"

Tag summary

Content type

Image

Digest

Size

28.4 MB

Last updated

over 7 years ago

docker pull djieno/alpine-k3s:amd64