How to Connect to Docker boxes when using executor type docker

networking
docker

#1

I’m using CircleCi 2.0 and am using the docker executor type. I have a basic ubuntu container I’m using as my build environment image. In that I’m spinning up a new nginx container and exposing port 80, but I cannot connect to the docker container from the primary container. Is there anything I need to specify. Here’s how I’m spinning up my docker container (from inside the ubuntu docker container).

docker run -d -p 80:80 $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$CIRCLE_PROJECT_REPONAME:$CIRCLE_SHA1

The container deploys fine. The only issue is the fact that I can’t test it before deploying.


Can't connect to docker container
#2

I’m having pretty much the same issue, so keeping your post up to see if we get an answer! Running protractor/selenium tests against container


#3

So figured this out. Because you are booting up in a docker container, you can’t connect to your containers (https://circleci.com/docs/2.0/building-docker-images/#accessing-services)

What I had to resort to was the following docker run --rm byrnedo/alpine curl 172.17.0.1:80


#4

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.