Help us understand the problem. What is going on with this article?

Dockerバイナリを最新にする

More than 1 year has passed since last update.

ここに書くメモは凄く雑なやり方です。本来は rpm パッケージが上がるのを待つか、自分で rpm パッケージを作っていれるべきと思われます。

Docker 17.05 の新機能のマルチステージビルドをしたかった

マルチステージビルドってのは↓こういうDockerfileが書けるようにする機能ね(FROM xx AS buildCOPY --from=build 辺り)

FROM golang:1.8.3 AS build
WORKDIR /go/src/github.com/kawaz/foo
COPY glide.yaml glide.lock .
RUN glide install
COPY . .
RUN CGO_ENABLE=0 GOOS=linux go build -a -tags netgo -installsuffix netgo --ldflags '-extldflags "-static"' && rm -rf vendor .glide

FROM alpine
RUN apk add --no-cache --update tzdata ca-certificates curl
WORKDIR /app
COPY --from=build /go/src/github.com/kawaz/foo/foo .
CMD [ "./foo" ]

AmazonLinux の Docker は 17.03 だったのでバイナリ差し替えで上げた(エントリ投稿時点で 17.06.2-ce が入った)

sudo service docker stop
curl -sL \
  "https://download.docker.com/linux/static/stable/x86_64/$(curl -s https://download.docker.com/linux/static/stable/x86_64/|grep -oE 'docker-[0-9\.]+-ce.tgz' | sort -Vr | head -n1)" | \
  sudo tar xz -C /usr/bin --strip=1 'docker/docker*'
sudo service docker start

アーカイブの中身は以下のような感じにバイナリが8個入ってるだけなのでこれを /usr/bin に上書きで突っ込んでただけ。

  • docker/docker
  • docker/docker-containerd
  • docker/docker-containerd-ctr
  • docker/docker-containerd-shim
  • docker/docker-init
  • docker/docker-proxy
  • docker/docker-runc
  • docker/dockerd
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away