-
Notifications
You must be signed in to change notification settings - Fork 206
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
Upgrade docker cli to 18.06 #99
Conversation
To allow multi-staged builds, Docker 17.05 is required or higher is required on the daemon and the client.
@tirumaraiselvan I've gone ahead and updated the release URL from Please let me know if we can polish this up any further 😁 |
@seanprashad I am not able to build this. Try Basically this fails
|
@tirumaraiselvan Something odd is up - even the old link for I'm going to see why the download link has changed! Update: Other users are experiencing this too: moby/moby#38105 |
build/gitkubed/Dockerfile
Outdated
&& mv /tmp/docker/docker /bin/docker \ | ||
&& rm -rf /tmp/docker-1.12 /tmp/docker \ | ||
&& rm -rf /tmp/docker-17.05 /tmp/docker \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this can be simplified by using COPY --from
, and copying the binary from the official Docker images.
For example; the following example pulls the docker:18.06.1
image (if it's not available locally), copies the docker
to /bin/docker
in a scratch
image;
docker build -t docker-client -<<EOF
FROM scratch
COPY --from=docker:18.06.1 /usr/local/bin/docker /bin/docker
ENTRYPOINT ["/bin/docker"]
EOF
Which, when bind-mounting /var/run
(to give access to the local daemon's socket), gives a functional docker
cli;
$ docker run --rm -v /var/run/:/var/run/ docker-client version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:20:43 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:29:02 2018
OS/Arch: linux/amd64
Experimental: true
build/gitkubed/Dockerfile
Outdated
@@ -4,10 +4,10 @@ MAINTAINER tiru@hasura.io | |||
# Install openssh server | |||
RUN apt-get update \ | |||
&& apt-get install -y upx-ucl binutils curl openssh-server git jq \ | |||
&& curl -o /tmp/docker-1.12 'https://get.docker.com/builds/Linux/x86_64/docker-1.12.6.tgz' \ | |||
&& tar -xf /tmp/docker-1.12 -C /tmp \ | |||
&& curl -o /tmp/docker-17.05 'https://get.docker.com/builds/Linux/x86_64/docker-17.05.0-ce.tgz' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would discourage using docker 17.05 (that was an edge release, and does have some known vulnerabilities - given, those were in the daemon, not the CLI); current versions of docker can be found on download.docker.com (get.docker.com is no longer being updated with new versions); static amd64 (x86_64) binaries can be found (e.g.) here; https://download.docker.com/linux/static/stable/x86_64/
@tirumaraiselvan I've updated the docker image to If you could pull down the latest commit and test it locally, that would be great! |
@seanprashad Shouldn't we use version 18.06 since that is out now? |
Good idea @tirumaraiselvan! I've made the changes and rebuilt it locally with no errors: If we can make this any better, please let me know! 😁 |
&& curl -o /tmp/docker-1.12 'https://get.docker.com/builds/Linux/x86_64/docker-1.12.6.tgz' \ | ||
&& tar -xf /tmp/docker-1.12 -C /tmp \ | ||
&& curl -o /tmp/docker-18.06 'https://download.docker.com/linux/static/stable/x86_64/docker-18.06.1-ce.tgz' \ | ||
&& tar -xf /tmp/docker-18.06 -C /tmp \ | ||
&& mv /tmp/docker/docker /bin/docker \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason the server isn't upgrading even after changing the potentially buggy L9. I changed L9 to cp /tmp/docker/* /bin/
to copy all the binaries including dockerd yet:
root@gitkubed-6cf7744876-jwg2w:/# docker version
Client:
Version: 18.06.1-ce
API version: 1.27 (downgraded from 1.38)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:20:43 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 17.03.2-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.9.2
Git commit: f5ec1e2
Built: Fri Aug 10 11:50:21 2018
OS/Arch: linux/amd64
Experimental: false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the container just taking to the host daemon (through a bind-mounted /var/run/docker.sock
? The Dockerfile only installs the docker cli, not the daemon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Completely missed it :) Hmm, so no way to solve this if cloud providers don't give us newer docker.
Docker cli has been upgraded but will be ineffective if the underlying host docker is not > 17.06 |
Fixes #92: Multi-staged builds
To allow multi-staged builds, Docker 17.05 is required or higher is required on the daemon and the client. Documentation for Docker can be found here.