docker-archive / compose-cli

Easily run your Compose application to the cloud with compose-cli
Apache License 2.0
957 stars 255 forks source link

Compose network issue #1973

Closed jJohannesson closed 3 years ago

jJohannesson commented 3 years ago

Description My compose project has two containers, one database container (ibmcom/db2) and one application server (daggerok/jboss-eap-7.2). To connect between them I have defined a network in the compose yml file where the database has a specific alias that my application server uses to connect to the database.

I have now tested to use the new docker compose command (new with space between) instead of docker-compose command. But my application server can't find the name. It can when running with the old docker-compose command.

Steps to reproduce the issue:

  1. Define a database container.
  2. Define an application server container with used database driver.
  3. Define a datasource in the application server that uses the driver to connect to database. URL includes alias from compose file.
  4. Test connection.

Describe the results you received: The application server can't connect to database as host name is not known.

Describe the results you expected: Connected ok.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version: $ docker version Client: Cloud integration: 1.0.14 Version: 20.10.6 API version: 1.41 Go version: go1.16.3 Git commit: 370c289 Built: Fri Apr 9 22:49:36 2021 OS/Arch: windows/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.6 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 8728dd2 Built: Fri Apr 9 22:44:56 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.4 GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e runc: Version: 1.0.0-rc93 GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec docker-init: Version: 0.19.0 GitCommit: de40ad0

Output of docker info:

$ docker info Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Build with BuildKit (Docker Inc., v0.5.1-docker) compose: Docker Compose (Docker Inc., 2.0.0-beta.1) scan: Docker Scan (Docker Inc., v0.8.0)

Server: Containers: 2 Running: 2 Paused: 0 Stopped: 0 Images: 7 Server Version: 20.10.6 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e runc version: 12644e614e25b05da6fd08a38ffa0cfe1903fdec init version: de40ad0 Security Options: seccomp Profile: default Kernel Version: 5.10.25-linuxkit Operating System: Docker Desktop OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 7.775GiB Name: docker-desktop ID: IKII:RW23:OSDA:5IT7:WCTZ:TNN4:GXJV:77QD:5JOC:V7SG:AV2X:RSWO Docker Root Dir: /var/lib/docker Debug Mode: true File Descriptors: 66 Goroutines: 67 System Time: 2021-07-30T11:30:07.7456229Z EventsListeners: 5 Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: maven2.it.volvo.net:18443 maven2.it.volvo.net:18536 127.0.0.0/8 Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.): docker-compose.txt

ndeloof commented 3 years ago

Compose V2 version you run "Docker Compose (Docker Inc., 2.0.0-beta.1)" is obsolete, last release is beta-6 and many fixes have been introduced, including support for network aliasses and links

Please try using latest binary from this repo, which you can place into $HOME/.docker/cli-plugins

jJohannesson commented 3 years ago

Sweet. Yes that seems to works fine. Great. :-) Closing the issue.

Thanks!