1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

kustomizeのイメージを作ってみた

Posted at

kustomizeコマンドを実行したいけど、いろいろな事情で実行サーバにkustomizeをインストールせずに解決しなくてはならない事象が発生しました。

そんな時に便利なのがやっぱりDocker!

kustomizeだけが入ったイメージを作って、その中にkustomizeコマンドを実行したいソースをマウントすればいける!と思い、kustomizeのイメージを作成してみたというのが今回の内容となります。

Dockerhubはこちら

Dockerfileはこんな感じ

FROM alpine:3.9 as builder

ENV KUSTOMIZE_VERSION 3.4.0

RUN wget https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz \
  && tar xzf ./kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz \
  && mv kustomize /usr/local/bin/kustomize \
  && rm kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz \
  && chmod +x /usr/local/bin/kustomize

FROM scratch

COPY --from=builder /usr/local/bin/kustomize /usr/local/bin/kustomize

ENTRYPOINT [ "kustomize" ]

Dockerhubのimageを使う場合は、こんな感じで実行できます。

$ docker run --rm sincek/kustomize version
{Version:kustomize/v3.4.0 GitCommit:2c9635967a2b1469d605a91a1d040bd27c73ca7d BuildDate:2019-11-12T05:00:57Z GoOs:linux GoArch:amd64}
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?