Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux instructions via Dockerfile #39

Open
DazWilkin opened this issue Jul 30, 2018 · 1 comment
Open

Linux instructions via Dockerfile #39

DazWilkin opened this issue Jul 30, 2018 · 1 comment

Comments

@DazWilkin
Copy link

DazWilkin commented Jul 30, 2018

Learned of Krex when @kris-nova demonstrated it during TGI Kubernetes #41.

It's neat. Thank you for creating it.

The following should (!?) get you containerized Krex:

Dockerfile.stretch:

FROM golang:1.10.3-stretch

LABEL maintainer="Your Name<[email protected]>"

RUN apt update && \
    apt install -y \
        libncurses5-dev \
        libncursesw5-dev

RUN go get github.com/kris-nova/krex

ENTRYPOINT ["/go/bin/krex"]

Dockerfile.alpine:
NB This image is problematic in rendering the curses-based UI accurately. It works but the painting is inconsistent.

FROM golang:1.10.3-alpine3.8

LABEL maintainer="Your Name<[email protected]>"

RUN apk update && \
    apk add --no-cache \
        build-base \
        git \
        ncurses-libs \
        ncurses-dev

RUN go get github.com/kris-nova/krex

ENTRYPOINT ["/go/bin/krex"]

Dockerfile.debian -- to see how to burst this to a local Linux install:

FROM debian:jessie

LABEL maintainer="Your Name<[email protected]>"

RUN apt update && \
    apt install -y \
        git \
        gcc \
        libncurses5-dev \
        libncursesw5-dev \
        make \
        pkg-config \
        wget

# Install Golang

# Defaults for the Golang installation
ARG VERSION=1.10.3
ARG OS=linux
ARG ARCH=amd64

# Construct the filename, download it, install then tidy up
RUN FILE="go${VERSION}.${OS}-${ARCH}.tar.gz" && \
    wget \
      --quiet \
      --relative \
      --output-document=$PWD/${FILE} \
      https://dl.google.com/go/${FILE} && \
    tar \
      --directory /usr/local \
      --extract \
      --gunzip \
      --file ${FILE} && \
    rm ${FILE}

# Update the path for Golang
ENV PATH=${PATH}:/usr/local/go/bin

# Create a workspace for Krex, then get (incl. build) it
RUN mkdir ${PWD}/go

ENV GOPATH=${PWD}/go
ENV PATH=${PATH}:${GOPATH}/bin

RUN go get github.com/kris-nova/krex

ENTRYPOINT ["/go/bin/krex"]

When you run the container, you can bind it to the local ${HOME}/.kube/config with:

docker run \
--interactive \
--tty \
--volume=${HOME}/.kube/config:/root/.kube/config krex

If, like me, you're using Kubernetes Engine which depends upon a gcloud helper to generate credentials tokens for the cluster, you (a) must add python to the installs; and (b) can bind gcloud and ${HOME}/.config/gcloud with:

docker run \
--interactive \
--tty \
--volume=${HOME}/.kube/config:/root/.kube/config \
--volume=${HOME}/.config/gcloud:/root/.config/gcloud \
--volume=/usr/lib/google-cloud-sdk:/usr/lib/google-cloud-sdk \
krex
@rugwirobaker
Copy link

Great thank you

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

No branches or pull requests

2 participants