CircleCI 2.0 Host - Connection refused



Like severals previous topic, I have a problem during my builds on CircleCi version 2.0

I’m using the docker executorType with the setup remote docker option.

I’m using also an ubuntu:16.04 image that I customize after with some depedencies (curl, git, php, etc…)

The /etc/hosts file is edited with a new line as :

So, during the CircleCI builds, my Docker containers are built and up via docker-compose and there is no problems here.

One of these containers that I will named mainContainer is exposed with ports 80.

Now, I want to test my URL address that I specified inside my /etc/hosts via a CURL command as :

curl -v

And this is the results of the command :

* Rebuilt URL to:
*   Trying
* connect to port 80 failed: Connection refused
* Failed to connect to port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to port 80: Connection refused

What’s wrong ? This configuration works on local. Here is my circle.yml :

version: 2
- image: ubuntu:16.04
TZ: "/usr/share/zoneinfo/Europe/paris"
- setup_remote_docker
- run:
name: Install dependencies
command: |
uname -a
apt-get update && apt-get install -y curl wget bzip2 npm python-pip php php7.0-xml sshpass vim libfontconfig git
- checkout
- run:
name: Install Docker client
command: |
set -x
curl -L -o /tmp/docker-$VER.tgz$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- run:
name: Install Docker Compose
command: pip install docker-compose
- run:
name: Add vhost
command: echo | tee -a /etc/hosts
- run:
name: Build application Docker image PHP 5.6
command: |
docker-compose -f docker-compose.yml -f docker-compose.stage.yml build
- run:
name: Up PHP 5.6 container
command: |
docker-compose -f docker-compose.yml -f docker-compose.stage.yml up -d
sleep 60
- run:
name: Test Page URL
command: |
curl --retry 30 --retry-delay 3 -v

Thank you to help me :sob:


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