Open kbakk opened 5 years ago
Can you run Docker containers at all? You may need to run circleci as a user with permission to use Docker on your system (or grant permission to use Docker to your current user). Try adding yourself to the docker group, log out and in again, then try the circleci command.
@exarkun I'm running this on my MacOS, with my own user - the issue isn't to start docker containers, the circleci command itself launches a container, which runs fine (I'm also able to run containers with docker run) - but to use docker commands inside the circleci container.
I have come across this workaround on stackoverflow.com, it let's me work around the issue. However, I believe this should be addressed on the circleci client.
Logged as CIRCLE-25053
Experiencing the same on a local environment with circleci cli 0.1.7868+fa5217e (release).
A workaround for me was to use docker executor with the root user:
test-executor:
docker:
- image: cimg/go:1.13
user: root
@davidmontoyago where in my yaml do I put that? I put it at the top level and it didn't do anything.
I just tried your workaround @davidmontoyago thanks!
@SeanHayes if you're still wondering, this goes in your circleci yaml next to the docker image your job is running in. Here's a screenshot of the first few lines of my "build" job:
It wasn't obvious to me either where to put this 😺
Maybe too late for the party, but the user: root
workaround brings too many problems for me, so I figured out we an use SUID to become root only when running docker commands:
commands:
# Only used for local jobs docker execution
setup_local_docker:
steps:
- run:
name: Use sudo docker in local builds
command: |
if [[ $CIRCLE_SHELL_ENV == *"localbuild"* ]]; then
sudo chmod u+s $(which docker)
fi
jobs:
test:
steps:
- setup_remote_docker
- setup_local_docker
- ...
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Have a minimalistic repo:
Running this locally results in the following output with error:
What is the expected behavior?
Expect task to succeed, with the busybox command creating and running a container.
Which version of the CLI and OS are you using? Did this work in previous versions?
If you have any questions, feel free to ping us at @CircleCI-Public/dx-clients.