Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port number is string instead intereger in docker convert command #9916

Closed
AlexNik opened this issue Oct 15, 2022 · 4 comments
Closed

Port number is string instead intereger in docker convert command #9916

AlexNik opened this issue Oct 15, 2022 · 4 comments

Comments

@AlexNik
Copy link

AlexNik commented Oct 15, 2022

Description

Can not pass docker compose output to docker stack deploy command.

Steps To Reproduce

  1. docker-compose.yml
version: "3.9"
services:
  nginx:
    image: nginx
    ports:
      - "80:80"
  1. docker compose convert output
name: composebug
services:
  nginx:
    image: nginx
    networks:
      default: null
    ports:
    - mode: ingress
      target: 80
      published: "80"            <--------- STRING instead INTEGER
      protocol: tcp
networks:
  default:
    name: composebug_default

Compose Version

Docker Compose version v2.11.2


docker-compose version 1.29.1, build unknown
docker-py version: 5.0.0
CPython version: 3.8.9
OpenSSL version: OpenSSL 1.1.1  11 Sep 2018

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.0-docker)
  compose: Docker Compose (Docker Inc., v2.11.2)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Containers: 6
  Running: 0
  Paused: 0
  Stopped: 6
 Images: 194
 Server Version: 20.10.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 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: active
  NodeID: 15remj0l09wglxwae4mguln85
  Is Manager: true
  ClusterID: ka36yctf8ep6keflzqi6ou93a
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 192.168.44.76
  Manager Addresses:
   192.168.44.76:2377
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-193-generic
 Operating System: Ubuntu 18.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 7.788GiB
 Name: alex
 ID: OQE4:TJOF:DDEG:SRFV:76E3:QW7B:VTYV:F647:3TRW:3GTN:AQYG:7VK2
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: alexnik
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

Need for proper work with docker compose v2+ moby/moby#29133 (comment)

@AhmedGrati
Copy link
Contributor

Can I try to work on it?

@glours
Copy link
Contributor

glours commented Oct 17, 2022

@AhmedGrati yes sure, I just want to let you know that most of the conversion work is done in compose-go and that the published port could also be a range and should be return as a string in this case

@ndeloof
Copy link
Contributor

ndeloof commented Mar 27, 2023

docker stack deploy does not follow the compose specification, you should not mix docker compose and docker stack commands.

@ndeloof ndeloof closed this as completed Mar 27, 2023
@ndeloof
Copy link
Contributor

ndeloof commented Mar 27, 2023

Closing this issue as things are valid regarding docker compose and compose-spec.
See docker/cli#2527 for lack of support for the compose specification by docker stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants