Skip to content

Add docker app image#615

Open
willcl-ark wants to merge 2 commits into
bitcoin-dev-project:mainfrom
willcl-ark:app-image
Open

Add docker app image#615
willcl-ark wants to merge 2 commits into
bitcoin-dev-project:mainfrom
willcl-ark:app-image

Conversation

@willcl-ark

Copy link
Copy Markdown
Contributor

Ok I think this is better than a flatpak (more cross-platform).

Builds a docker image with:

  • warnet
  • k9s
  • kubectl
  • ktop

...installed.

I set fish as the default shell, as that gets you pretty tab-autocompletion.

All that's needed is to configure ~/.kube/config inside the machine (does warnet auth do this?), and you're good to go.

Current CI is set to build PR branches and pushes to master (tagged as latest), but we can change that if desired.

I will add a test command for it after the image has built in the first run here.

@willcl-ark

Copy link
Copy Markdown
Contributor Author

Ah, I think perhaps a new workflow from a PR (from a fork) cannot access repo secrets (username and password) causing the login failure?

The run here works, and will allow testing with:

docker run -it will8clark/warnet-app:pr-31

You should configure ~/.kube/config inside the container in the normal way. then you can interact with a cluster as usual.

If you are trying to use a local cluster, then you will need to allow the docker container to talk to (outer) host with --net=host, i.e. by using:

docker run --net=host -it will8clark/warnet-app:pr-31

This will allow the container, when looking up a cluster with an address like 0.0.0.0:42813, to find it on the local cluster. This is probably also possible to set up with specific port forwarding, but you'd need to know the cluster port before starting etc.

@willcl-ark
willcl-ark marked this pull request as ready for review September 19, 2024 09:16
@mplsgrant

Copy link
Copy Markdown
Collaborator

Cool!

This seems to work. I needed to add bash to the Dockerfile because we need that until we move away from kubectl.

I was able to connect to a remote cluster by using a config file. I was also able to connect to my local minikube by copying my minikube data dir to the container.

@willcl-ark

Copy link
Copy Markdown
Contributor Author

Cool!

This seems to work. I needed to add bash to the Dockerfile because we need that until we move away from kubectl.

I was able to connect to a remote cluster by using a config file. I was also able to connect to my local minikube by copying my minikube data dir to the container.

Thanks for testing. I added bash to the latest image (building now over in https://github.com/willcl-ark/warnet/pull/31/checks...)

@mercie-ux

Copy link
Copy Markdown

Great idea bundling all the tools into one image, saves contributors a lot of setup time.
Tested locally and everything works.

COPY --from=ghcr.io/astral-sh/uv:0.4.12 /uv /bin/uv
COPY --from=ghcr.io/vladimirvivien/ktop:latest /ko-app/ktop /bin/ktop

RUN apk add --no-cache bash curl ca-certificates git kubectl helm k9s fish vim mc nano

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUN apk add --no-cache bash curl ca-certificates git kubectl helm fish vim mc nano && \ curl -sL https://github.com/derailed/k9s/releases/latest/download/k9s_Linux_amd64.tar.gz | tar -xz -C /usr/local/bin k9s

The Dockerfile build is currently broken, k9s doesn't appear to be available in the Alpine package registry, so apk add k9s fails with exit code 10. It's possible it was available when this PR was first opened but has since been removed. I Downloaded the binary directly from GitHub releases and it fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants