Hi!
In Cloud Build I want to access a NATS Streaming Server running in a Docker container from inside a Gradle container (the Gradle container is building my Java application).
Unfortunately the NATS Streaming Server isn't visible from another build step. Maybe you can help me to see where I err.
This is my docker-compose.yaml file:
version: '3.7'
services:
nats-streaming:
container_name: nats-streaming
image: nats-streaming:latest
ports:
- 4222:4222
This is my cloudbuild.yaml file:
steps:
- name: 'docker/compose:1.24.1'
args: ['up', '-d']
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: /bin/sh
args:
- '-c'
- |
set -x && \
curl nats-streaming:4222
And this is the error message I'm getting:
Step #1: + curl nats-streaming:4222
Step #1: % Total % Received % Xferd Average Speed Time Time Time Current
Step #1: Dload Upload Total Spent Left Speed
Step #1:
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: nats-streaming
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/cloud-builders/gcloud" failed: exit status 6
Step #0:
Creating nats-streaming ... done
According to the tutorial the Docker container should be accessible via it's name. But nats-streaming can't be resolved.
Do you have any ideas what I'm doing wrong?
Greetings
Lionel