Skip to content

Instantly share code, notes, and snippets.

@dsiebel
Last active April 9, 2020 08:30
Show Gist options
  • Save dsiebel/33c7e21abeb043a38d23d98d7eecf316 to your computer and use it in GitHub Desktop.
Save dsiebel/33c7e21abeb043a38d23d98d7eecf316 to your computer and use it in GitHub Desktop.
A Dockerfile for https://octant.dev/
#!/usr/bin/env bash
OCTANT_IMAGE=dsiebel/octant
OCTANT_VERSION=0.11.1
docker build \
--tag ${OCTANT_IMAGE}:${OCTANT_VERSION} \
--build-arg OCTANT_VERSION=${OCTANT_VERSION} \
--file ./octant.Dockerfile \
.
FROM debian:stretch-slim as octant-build
WORKDIR /
RUN DEBIAN_FRONTEND=noninteractive; \
apt-get update && \
apt-get install \
--auto-remove \
--no-install-recommends \
--no-install-suggests \
--show-upgraded \
--yes \
ca-certificates \
curl
ARG OCTANT_VERSION
RUN curl -L -O "https://github.com/vmware-tanzu/octant/releases/download/v${OCTANT_VERSION}/octant_${OCTANT_VERSION}_Linux-64bit.tar.gz" \
&& tar -xzf octant_${OCTANT_VERSION}_Linux-64bit.tar.gz \
&& cp octant_${OCTANT_VERSION}_Linux-64bit/octant /octant
FROM scratch as octant
WORKDIR /tmp
COPY --from=octant-build /octant /octant
EXPOSE 7777
VOLUME /kubeconfig
ENTRYPOINT [ "/octant", \
"--disable-open-browser", \
"--listener-addr", "0.0.0.0:7777" \
"--kubeconfig", "/kubeconfig" ]
@dsiebel
Copy link
Author

dsiebel commented Apr 9, 2020

Switching contexts doesn't work right now if the context requires auth. For GKE for example it requires gcloud-sdk which most likely will not be installed where it is on the host system...
Workaround: switch to the context you want to look at, then run octant-docker.

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