micahhausler / container-tx

container-transform in go
MIT License
11 stars 2 forks source link

parsing "5900/tcp": invalid syntax #3

Open TylerRick opened 6 years ago

TylerRick commented 6 years ago

Although I don't add the /tcp port myself, when you output your config using docker-compose config, it looks like it automatically adds it for you.

cat docker-compose.yml 
version: '2'
services:
  chrome:
    image: scratch
    ports:
      - 5900:5900
docker-compose config
networks: {}
services:
  chrome:
    image: scratch
    ports:
    - 5900:5900/tcp
version: '2.0'
volumes: {}
⟫ docker-compose config | ./container-tx 
panic: strconv.ParseInt: parsing "5900/tcp": invalid syntax

Note: The reason output my config using docker-compose config instead of using the docker-compose.yml as input directly is because my config is spread across multiple file using extends. But container-tx is expecting a single file, and docker-compose config conveniently generates such as combined single file.

I can easily work around by saving to a temporary file and removing the /tcp parts.

micahhausler commented 6 years ago

Honestly since I started using Kubernetes, I've not touched docker-compose a whole lot, so config is new to me (but looks great)! That is really handy that config merges multiple files for you, and yea it makes sense to be able to parse the protocol