Skip to content

Commit

Permalink
feat: more complete Dockerfile (#243)
Browse files Browse the repository at this point in the history
Adds several dependencies to the `Dockerfile`, so that Tanka can be
actuall used from there:

- `kubectl`, using the offical binary download
- `jsonnet-bundler`, compiling from source
- `less`, `git` and `diff` using alpine packages
  • Loading branch information
sh0rez authored Mar 18, 2020
1 parent 88a6791 commit a3aaf4d
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
FROM alpine
# download kubectl
FROM alpine as kubectl
RUN apk add --no-cache curl
RUN export VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) &&\
curl -o /usr/local/bin/kubectl -L https://storage.googleapis.com/kubernetes-release/release/${VERSION}/bin/linux/amd64/kubectl &&\
chmod +x /usr/local/bin/kubectl

# less with `--RAW-CONTROL-CHARS` is required for tk show/ tk diff
RUN apk add --no-cache less
# build jsonnet-bundler
FROM golang as jb
WORKDIR /tmp
RUN git clone https://github.com/jsonnet-bundler/jsonnet-bundler &&\
cd jsonnet-bundler &&\
make static &&\
mv _output/jb /usr/local/bin/jb

# assemble final container
FROM alpine
RUN apk add --no-cache coreutils diffutils less git
COPY tk /usr/local/bin/tk
COPY --from=kubectl /usr/local/bin/kubectl /usr/local/bin/kubectl
COPY --from=jb /usr/local/bin/jb /usr/local/bin/jb
WORKDIR /app
ENTRYPOINT ["/usr/local/bin/tk"]


0 comments on commit a3aaf4d

Please sign in to comment.