Build failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Hi some of our jobs have started failing when executing docker build commands
e.g. sudo docker build -t someimage:latest -t someimage:$APPVEYOR_BUILD_VERSION .
Nothing has changed recently and this has definitely worked previously lots of times.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Dave Bown on 16 Nov, 2018 12:55 PM
Oops should have said we're running this on an 'Ubuntu' environment.
2 Posted by Ilya Finkelshte... on 16 Nov, 2018 11:18 PM
This is probably side effect of recent Ubuntu image update. Please use respective "previous" image while we are investigating. Also please subscribe to "Technical updates" at https://ci.appveyor.com/notifications to decrease number of surprises like this. It is safe, we send only important technical info and not that often.
3 Posted by Dave Bown on 17 Nov, 2018 10:14 AM
Just tried switching to the "Previous Ubuntu" image on one of the job and i still get the same error.
4 Posted by Dave Bown on 17 Nov, 2018 10:15 AM
I have subscribed to technical notifications as you requested also.
5 Posted by Wasa Pleshakov on 17 Nov, 2018 01:49 PM
Do you enable docker in the image with
services: docker
in appveyor.yml as it described in https://www.appveyor.com/docs/getting-started-with-appveyor-for-lin... ?6 Posted by Dave Bown on 17 Nov, 2018 08:38 PM
No, never been necessary, and unfortunately we're not using appveyor.yml files and configure things using the UI. Docker doesn't appear in the Services drop down list on the environment tab in settings unfortunately. Is this something you can add?
7 Posted by tadly on 18 Nov, 2018 07:48 AM
Having the same issue and I do have docker enabled in my appveyor.yaml
For reference:
Here's my appveyor.yaml and here's the failing build
8 Posted by Wasa Pleshakov on 19 Nov, 2018 10:38 AM
Dave, I'm not UI guy, but I think it is possible to add docker in Services dropdown. I'll back to you with this after some internal discussion.
Another way to fix this issue is add
sudo service docker start
command right before yoursudo docker build ...
command.9 Posted by Wasa Pleshakov on 19 Nov, 2018 10:50 AM
Tadly,
Or you can move yourFrom the failing build log, I see that you run
docker build ...
on install phase of the build. Our build pipeline run install scripts first (step #4) then starts services (step #7).To fix this issue you can add
sudo service docker start
in yourinstall
script:docker build ...
frominstall
step tobefore_build
step: In my opinion, the second way looks more logical.10 Posted by tadly on 19 Nov, 2018 11:01 AM
Yeah, I also like the second option much better.
Guess the build pipeline changed recently in this regard.
Anyways. Fixed now, thanks :)
11 Posted by Dave Bown on 19 Nov, 2018 11:04 AM
I've added the 'sudo service docker start' to my install script. The docker build actions are actually in the 'After build script', according to the UI anyway.
I've queued a build, we'll see what happens.
12 Posted by Dave Bown on 19 Nov, 2018 11:08 AM
It failed but I now realise I'm actually wrong, this must be the one and only build job where we are actually running with an appveyor.yml file, hence none of my ui changes have taken affect. I'll modify the yml file and hopefully that will fix it, I'm reasonably confident that this will solve it and I'd have actually found the solution earlier if I'd known that none of my changes were working.
13 Posted by Dave Bown on 19 Nov, 2018 11:35 AM
Thanks for your advice adding the following to the yml file as you suggested solve the problem.
services:
- docker
Clearly the project was setup using the UI initially but changed exported to a yml file later.
So my two pieces of feedback on this ticket are:
1. Would be really good to get the Docker option in the services combo box in the ui asap if possible because most of our builds are configured using the UI.
2. How do you know for sure if the build is using a yml file or the settings in the UI? Does the UI currently address this in someway I've missed? Or could this be improved?
14 Posted by Florian Feldhau... on 26 Nov, 2018 03:53 PM
One more question. Is it possible to only enable the docker service for specific build configurations?
15 Posted by Dave Bown on 26 Nov, 2018 03:54 PM
Hi, I'm away on annual leave till Monday 26th of November. I will not be regularly checking my email or contactable by phone. If you need assistance you can log support tickets using your Office 365 account at https://myday.freshdesk.com, Alterantively e-mail [email blocked] or telephone 0845 050 7380. Best regards Dave Bown Technical Director, Collabco Software
16 Posted by Owen McDonnell on 26 Nov, 2018 06:10 PM
@Florian, You should be able to achieve this with
for:
construct.Ilya Finkelshteyn closed this discussion on 26 Jan, 2019 09:00 PM.