Code Monkey home page Code Monkey logo

Comments (2)

FA-tvonmoll avatar FA-tvonmoll commented on September 28, 2024

I'm also seeing closed #90, but that doesn't really help this current situation (the linked examples just show the host and port resolving to container_name and the external port in the compose configuration).

from cloud-builders-community.

FA-tvonmoll avatar FA-tvonmoll commented on September 28, 2024

Ah, so a couple of crucial observations here:

  1. It is indeed container_name; but it's the internal port (which means mapping the port to the docker host is superfluous).

  2. It's different for gcr.io/cloud-builders/docker steps because (speculating) GCB is doing less under-the-hood. In a docker run step, you can get in with --network=cloudbuild (and port is still internal).

Example docker-compose.yml:

version: '3.4'
services:
  web-server:
    image: nginx
    container_name: web-server
networks:
  default:
    external:
      name: cloudbuild

and cloudbuild.yml with wget:

steps:
- name: 'docker/compose:1.22.0'
  args: ['up', '-d']
- name: 'gcr.io/cloud-builders/wget'
  args: ['http://web-server:80']

and cloudbuild.yml with docker run:

steps:
- name: 'docker/compose:1.22.0'
  args: ['up', '-d']
- name: 'gcr.io/cloud-builders/docker'
  args: ['run', '--network=cloudbuild', 'byrnedo/alpine-curl', 'http://web-server:80']

Before closing this: does that all smell correct, or am I missing something?

from cloud-builders-community.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.