louislam / dockge

A fancy, easy-to-use and reactive self-hosted docker compose.yaml stack-oriented manager
https://dockge.kuma.pet
MIT License
13.13k stars 375 forks source link

The web editor modifies the `dockerfile_inline` element when editing #673

Open lildata opened 4 days ago

lildata commented 4 days ago

⚠️ Please verify that this bug has NOT been reported before.

πŸ›‘οΈ Security Policy

Description

I encounter a strange web editor behavior when I edit a docker compose file with the dockerfile_inline element https://docs.docker.com/reference/compose-file/build/#dockerfile_inline

When I click Edit the editor will modify the inline dockerfile (| is replaced by > and a line is inserted between each lines) I did check (cat /opt/stacks/xxx/compose.yaml) it really happens at the opening for edit.

I do not see any error in the Console of the browser Web developer tools

πŸ‘Ÿ Reproduction steps

  1. Create a Compose with the dockerfile_inline element
  2. Save the file
  3. Edit the Compose (bug)

πŸ‘€ Expected behavior

I would expect my inline dockerfile not to be modified by the editor

build:
  context: .
  dockerfile_inline: |
    FROM baseimage
    RUN some command  
    ENTRPOINT hello

πŸ˜“ Actual Behavior

instead the | is replaced by > and a line is inserted between each lines of the inline dockerfile

build:
  context: .
  dockerfile_inline: >
    FROM baseimage

    RUN some command  

    ENTRYPOINT hello

I do not see any error in the Console of the browser Web developer tools

Dockge Version

1.4.2

πŸ’» Operating System and Arch

Alpine / amd64

🌐 Browser

Chromium: 129 and Firefox 131

πŸ‹ Docker Version

Docker 26.1.5

🟩 NodeJS Version

No response

πŸ“ Relevant log output

No response