I am using Alpine linux for my CI/CD machine. The docker file below:
FROM node:10.15-alpine
RUN npm i -g sequelize sequelize-cli mysql2
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk update
RUN apk add --update git bash openssh terraform aws-cli docker openrc
WORKDIR /var/app
Problem is when the CI tries to execute docker code, eg. docker login, it fails:
[Container] 2019/01/10 11:18:10 Running command $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[Container] 2019/01/10 11:18:10 Command did not exit successfully $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) exit status 1
When I try to add the line
RUN service docker start
I get docker already starting
How can I wait for docker to start then?