Error “Get https://registry-1.docker.io/v2/: net/http: request canceled” while building image

I think the issue is that you are behind the proxy which in which case you need to write a manual configuration in Docker systemd service file. That will override the default docker.service file. If you are using Docker for Windows, then simply set the default DNS to 8.8.8.8 on the “vEthernet (DockerNAT)” network adapter. … Read more

Is there a way to combine Docker images into 1 container?

You can, with the multi-stage builds feature introduced in Docker 1.17 Take a look at this: FROM golang:1.7.3 WORKDIR /go/src/github.com/alexellis/href-counter/ RUN go get -d -v golang.org/x/net/html COPY app.go . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM alpine:latest RUN apk –no-cache add ca-certificates WORKDIR /root/ COPY –from=0 /go/src/github.com/alexellis/href-counter/app . CMD [“./app”] … Read more

Error: Redis connection to 127.0.0.1:6379 failed – connect ECONNREFUSED 127.0.0.1:6379

Redis runs in a seperate container which has seperate virtual ethernet adapter and IP address to the container your node application is running in. You need to link the two containers or create a user defined network for them docker network create redis docker run -d –net “redis” –name redis redis docker run -d -p … Read more

docker run

To run multiple commands in docker, use /bin/bash -c and semicolon ; docker run image_name /bin/bash -c “cd /path/to/somewhere; python a.py” In case we need command2 (python) will be executed if and only if command1 (cd) returned zero (no error) exit status, use && instead of ; docker run image_name /bin/bash -c “cd /path/to/somewhere && … Read more