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

feat: more complete Dockerfile #243

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: more complete Dockerfile
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 committed Mar 18, 2020
commit d69169cd55b0689ebfddb6980cee88fcc5f4d03c
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"]