Sign inSign up

nextail/ubuntu-tini-dev-chrome-k8s

By nextail

Updated almost 2 years ago

Docker image with Kubernetes tools

Image
0

1.7K

nextail/ubuntu-tini-dev-chrome-k8s repository overview

Docker image with Chrome and Kubernetes tools

This is a Docker image based on nextail/ubuntu-tini-dev-chrome and includes various kubernetes tools.

Building

You can build the image like this:

#!/usr/bin/env bash

docker buildx build --platform=linux/amd64,linux/arm64 --no-cache \
  -t "nextail/ubuntu-tini-dev-chrome-k8s" \
  --label "maintainer=Ruben Suarez <[email protected]>" \
  .

docker buildx build --load \
	-t "nextail/ubuntu-tini-dev-chrome-k8s" \
	.

Running

You can run the container like this (change --rm with -d if you don't want the container to be removed on stop):

#!/usr/bin/env bash

# Get current user UID
USER_ID=$(id -u)
# Get current user main GID
GROUP_ID=$(id -g)

prepare_docker_timezone() {
  # https://www.waysquare.com/how-to-change-docker-timezone/
  ENV_VARS+=" --env=TZ=$(cat /etc/timezone)"
}

prepare_docker_user_and_group() {
  RUNNER+=" --user=${USER_ID}:${GROUP_ID}"
}

prepare_docker_from_docker() {
    MOUNTS+=" --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker-host.sock"
}

prepare_docker_timezone
prepare_docker_user_and_group
prepare_docker_from_docker

docker run --rm -it \
  --name "ubuntu-tini-dev-chrome-k8s" \
  ${ENV_VARS} \
  ${MOUNTS} \
  ${RUNNER} \
  nextail/ubuntu-tini-dev-chrome-k8s "$@"

NOTE: Mounting /var/run/docker.sock allows host docker usage inside the container (docker-from-docker).

This way, the internal user UID and group GID are changed to the current host user:group launching the container and the existing files under his internal HOME directory that where owned by user and group are also updated to belong to the new UID:GID.

Connect

You can connect to the running container like this:

#!/usr/bin/env bash

docker exec -it \
  ubuntu-tini-dev-chrome-k8s \
  bash -l

This creates a bash shell run by the internal user.

Once connected...

You can check installed development software:

jq --version
helm version
kubectl version
kubectx
kubens
stern --help
k9s info
eksctl version
aws --version

Stop

You can stop the running container like this:

#!/usr/bin/env bash

docker stop \
  ubuntu-tini-dev-chrome-k8s

Start

If you run the container without --rm you can start it again like this:

#!/usr/bin/env bash

docker start \
  ubuntu-tini-dev-chrome-k8s

Remove

If you run the container without --rm you can remove once stopped like this:

#!/usr/bin/env bash

docker rm \
  ubuntu-tini-dev-chrome-k8s

Tag summary

Content type

Image

Digest

sha256:675f9f339

Size

1.8 GB

Last updated

almost 2 years ago

docker pull nextail/ubuntu-tini-dev-chrome-k8s