Created
April 7, 2020 16:34
-
-
Save dyennam/9fabc8f35929f9ca3de9c79ee3d54d31 to your computer and use it in GitHub Desktop.
Dockerfile for octact UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=0.11.1 | |
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 | |
FROM centos:centos7 as octant | |
WORKDIR /tmp | |
COPY k8configs/kubeconfig-k8s.yaml /usr/local/bin | |
# Checking if the file copied correctly | |
RUN cd /usr/local/bin && \ | |
ls -la &&\ | |
pwd | |
COPY --from=octant-build /octant /octant | |
EXPOSE 7777 | |
ENTRYPOINT [ "/octant", "--disable-open-browser", "--listener-addr", "0.0.0.0:7777", "--kubeconfig=/usr/local/bin/kubeconfig.k8s.yaml","--namespace=apicentral", "-v"] |
- it worked for me, but was very intermittent. As in sometimes when i open the octant URL, it shows me the pods in my default Namespace. But other times, it wont even load. I will Change it to root instead of ../bin and give it a shot.
- The build works, but it was never able to pick up the KUBECFG file at runtime. Issue could be, i was trying to place the KUBECFG in a directory which doesn't exist in scratch.
- I agree, will change it to something more sane. :)
Appreciate the feedback.
The problem with the --kubeconfig
flag in your Dockerfile is the =
. The line should read:
ENTRYPOINT [ "/octant", "--disable-open-browser", "--listener-addr", "0.0.0.0:7777", "--kubeconfig", "/usr/local/bin/kubeconfig.k8s.yaml","--namespace", "apicentral", "-v"]
The fun with golang cli arguments 🙄 ...
For me that works. However, switching contexts does not. The Problem here is that I am running macOS and the kubeconfig contains an absolute path to the auth provider for that kubernetes context. My cluster is located in Google Kubernetes Engine so it tries to run the google-cloud-sdk which does not exist in the linux container obviously. And if it does it wouldn't be located at /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/gcloud
. No solution for that one, yet.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... continuation of the discussion in vmware-archive/octant#507
A couple of things I noticed:
--kubeconfig
option does not seem to work, or at least it doesn't work how I would expect it to do. I fixed it by having the kubeconfig in the default path for the user running the container (root):/root/.kube/config/
scratch
isn't working for you. Does the build not work or just running octant in it?/usr/local/bin
is a directory for binaries/executables, configuration should reside either in the home directory of the user or in/usr/local/etc/
or/etc/