-
Notifications
You must be signed in to change notification settings - Fork 319
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
Update Docker to 19.03.8 #262
Conversation
FROM docker:18.09.0-dind | ||
FROM docker:19.03.5-dind | ||
|
||
ENV DOCKER_HOST=unix:///var/run/docker.sock |
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.
Are you sure this is required? The command execution is not loading env variables, so I think this change can simply get reverted.
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.
No, it won't work if you revert this, docker client will try to connect on default value of DOCKER_HOST
tcp://docker:2375
otherwise
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.
This is from the entrypoint calling dockerd-entrypoint.sh which calls docker-entrypoint.sh which sets DOCKER_HOST when unset. I don't think there's anything needed from those entrypoint scripts for drone so we could change the entrypoint to:
ENTRYPOINT ["/bin/drone-docker"]
and then remove the ENV DOCKER_HOST
for the same result. There's also no need for --host
when starting dockerd.
This docker update will also fix a docker daemon crash I have on production when drone is heavily loaded.
Crash fixed in moby/moby#38653 and backport here docker-archive/engine#162 released with version 18.09.3 and we use 18.09.0 |
3 days I'm using my custom image of this PR on production server with ~20/30 builds/day and so far so good! |
Here's an alternative that doesn't require setting DOCKER_HOST. I didn't see anything in the Let me know if I should sent that over as a PR. |
@sudo-bmitch the [1] https://github.com/docker-library/docker/blob/master/19.03/dind/dockerd-entrypoint.sh |
This change looks good to me. Before merging we should tag 18.09 so that we can rollback if needed. @ashwilliams1 @sudo-bmitch I am not sure if the docker-entrypoint file is still required. It used to run a bunch of commands required to bootstrap the container so that it could run docker-in-docker (mount various filesystems, configure cgroups, etc). This may no longer be the case. Before changing the entrypoint we would need to see published test results that would need to be reproduced and verified by others. I am not opposed and it would be great if we no longer needed this shell script, but at the same time I prefer to take a very conservative approach with this plugin given its widespread use. |
I don't see anything in the entrypoint scripts even being run with our default arguments, most every line is bypassed since our entrypoint arg is not a flag or docker command. Here's a run with the files modified with
The @tuxity FYI, I've also set |
@sudo-bmitch I think you are right but we still need people to test the change and verify the results. There are thousands of active installations using the latest version of this plugin, so we are extra careful with changes, even those that seem obvious. |
There is multiple ways to do it, I choose the way the closer of the actual flow to avoid any issues. I'm running this since 1 week now on production and no problems detected |
In this case I recommend we merge this pull request once we have a tag in place for 18.09. Separately I recommend @sudo-bmitch send a pull request that changes the entrypoint. We can ask the community to test the pull request and merge once these changes are tested and verified. |
I agree with @ashwilliams1, first getting an updated docker image, then improve the flow. Not both at the same time, it's too risky. Should I submit another PR using docker 18.09.8 then @bradrydzewski tag it ? And after that I can rebase this PR |
Some news, everything works fine after 21 days using my custom image with the changes at work. Sometimes containerd fail to start but I think it’s another issue since I already had this one before. |
Any update on this? Edit:
The same happens on my Drone setup with kubernetes runners. |
@kradalby I've been running my own version for months without issue (not counting an unrelated self inflicted TLS certificate expiration). Make sure you run the image as privileged since those we are testing are not in the whitelist by default. |
Still no issues on my side since I made the PR. @kradalby you need to add the privileged param like this:
|
args := []string{"--data-root", daemon.StoragePath} | ||
args := []string{ | ||
"--data-root", daemon.StoragePath, | ||
"--host=unix:///var/run/docker.sock", |
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.
hard-coding the unix socket would break the plugin for windows. Are we sure this change is necessary since DOCKER_HOST
is being set globally as an image environment variable?
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.
The other solution would be to listen on TCP socket without TLS, like this tcp://0.0.0.0:2375
.
Should I make the change ?
Mostly reproduce flow of https://github.com/docker-library/docker/blob/master/19.03/dind/dockerd-entrypoint.sh#L130 TCP socket with or without TLS isn't really needed for our usecase so it's disable
Switched from Unix socket without TLS to TCP socket without TLS to avoid messing with Windows version of the plugin. Also rebase from latest version of master branch, update docker dind from Should I squash commits? |
using TCP is not an option for this plugin, however, we should be able to solve this by delegating the command to the OS-specific files: https://github.com/drone-plugins/drone-docker/blob/master/daemon_win.go |
Ok, I will revert back to socket. But I have no idea how the plugin handle on Windows. It doesn't seems to have a dockerd so idk which path pass it as argument. |
After reviewing code, I don't understand how it will break Windows version, I only changed Linux Dockerfiles and Windows Dockerfiles already have an up to date version. Only |
We would really like to see this fix happening because we hit this issue quite a lot. |
@SPFZ does either this PR, or the one I linked, work for you? I believe the drone maintainers are looking for feedback from the community before approving. |
As commented in #244 few changes as been made to docker dind.
Per default, Docker daemon now listen on a UNIX AND TCP with TLS sockets, the client also tries to connect on the openned TCP socket (default behavior)
Since we don't need to expose Docker API with a TCP socket, I just started the daemon with UNIX socket and made the client trying to connect using UNIX socket like before.
I double checked docker entrypoint flow for this PR https://github.com/docker-library/docker/blob/master/19.03/dind/dockerd-entrypoint.sh#L129#L132 and since we start using
drone-docker
binary, almost all of this entrypoint code is uselessThe only doubt I have is, I needed to run my test image
tuxity/drone-docker
withprivileged: true
in order to correctly start the docker daemon. I guess it's because it's not an official image