GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community

docker-compose - resolving hostname

Open
#112 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
848
PR merge metrics
No merged PRs in 30d

Description

Greetings!

I'm having trouble connecting to a container after it has been started via `docker-compose` (following [the GCB docs](
https://cloud.google.com/cloud-build/docs/configuring-builds/build-test-deploy-artifacts#running_unit_tests_and_integration_tests)). I've also found some code to go with those steps from the docs [here](https://github.com/Philmod/gcb-docker-compose).

I'm likely just missing what the hostname becomes off of the `docker-compose up` step (and it's not as simple as the `container_name`).

Minimally reproducible compose is:

```yaml
version: '3.4'
services:
web-server:
image: nginx
container_name: web-server
ports:
- "8080:80"
networks:
default:
external:
name: cloudbuild
```

and cloudbuild is

```yaml
steps:
- name: 'docker/compose:1.22.0'
args: ['up', '-d']
- name: 'gcr.io/cloud-builders/docker'
args: ['run', 'byrnedo/alpine-curl', 'web-server:8080']
```

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.