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

Quotes automatically removed from docker-compose.prod.yml file, causing port issue #167

Open
microhobby opened this issue Feb 1, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@microhobby
Copy link
Collaborator

This was reported at https://community.toradex.com/t/quotes-automatically-removed-from-docker-compose-prod-yml-file-causing-port-issue/21677

I am using the .🔨-create-production-image script to build my application container and generate the docker-compose.prod.yml file. However, it seems to me that the quotes (or double-quotes) surrounding the values are removed and do not appear in the generated docker-compose.prod.yml.

This is especially annoying for the “ports” definition. Here is a quote from the compose file reference page:

When mapping ports in the HOST:CONTAINER format, you may experience erroneous results when using a container port lower than 60, because YAML parses numbers in the format xx:yy as a base-60 value. For this reason, we recommend always explicitly specifying your port mappings as strings.

So here is an example. I have a container which needs the port 21 to be exposed:

ftp_server:
    image: zhabba/pure-ftpd-arm64
    container_name: ftp_admin
    ports:
      - "21:21"
      - "30000-30009:30000-30009"

Once the .🔨-create-production-image script has been executed, the docker-compose.prod.yml file looks like this:

ftp_server:
    image: zhabba/pure-ftpd-arm64
    container_name: ftp_admin
    ports:
      - 21:21
      - 30000-30009:30000-30009

Finally, when running this on my board, I cannot access the FTP server.

@microhobby microhobby added bug Something isn't working enhancement New feature or request labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant