docs icon indicating copy to clipboard operation
docs copied to clipboard

Change naming pattern for Dockerfiles to <purpose>.Dockerfile

Open dan2k3k4 opened this issue 5 years ago β€’ 13 comments

Fixes #9245

dan2k3k4 avatar Apr 02 '20 11:04 dan2k3k4

@thaJeztah Could you PTAL?

usha-mandya avatar Apr 03 '20 07:04 usha-mandya

But this creates another issue: we no longer have syntax highlighting out-of-the-box.

What IDE are you using? In my IDE, it's configured to Highlight Dockerfile, *.Dockerfile and Dockerfile.*.

Not a big fan of changing this, because the Dockerfiles now no longer group together

thaJeztah avatar Apr 03 '20 12:04 thaJeztah

@thaJeztah Create a file like Dockerfile.php in PHPStorm or Microsoft VS code, it will think it's a "PHP" file because it's *.php.

dan2k3k4 avatar Apr 03 '20 13:04 dan2k3k4

I understand, but that's not at hand here; the Dockerfile.archive Dockerfile is only used by the docs team when creating an archive branch, so possibly we could even move it elsewhere if that's the biggest problem

thaJeztah avatar Apr 03 '20 13:04 thaJeztah

Ah for Dockerfile.archive - I can revert that change.

Perhaps we could mention that people could setup their Dockerfiles like this:

/project
  - /docker
    - /php
      - Dockerfile
    - /nginx
      - Dockerfile
    - /mariadb
      - Dockerfile

So that the path defines the grouping for the Dockerfile images?

I guess I just want to see some documentation to get people to avoid using a name like Dockerfile.php which could be parsed by PHP either in IDE or elsewhere πŸ˜„

dan2k3k4 avatar Apr 03 '20 14:04 dan2k3k4

@thaJeztah, I removed the changes to the Dockerfile.archive file

dan2k3k4 avatar Apr 10 '20 10:04 dan2k3k4

Deploy Preview for docsdocker ready!

Built without sensitive environment variables

Name Link
Latest commit 835c6f8f33cea040c9b8a83ccb1e3e93169c69a9
Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/62e2b891e4039e00083f70b3
Deploy Preview https://deploy-preview-10562--docsdocker.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Apr 10 '20 10:04 netlify[bot]

@dan2k3k4 @thaJeztah any updates on this topic?

Also what is currently more preferable without less issues in IDEs, Kubernetes etc.: Dockerfile.purpose vs purpose.Dockerfile?

Or is it still better to stay with the old approach like: root/docker/purpose/Dockerfile?

Regards, Thomas

ThomasLohmann avatar Aug 31 '21 17:08 ThomasLohmann

@ThomasLohmann we've been using <service-name>.dockerfile (e.g. php.dockerfile) and VSCode (and I believe Jetbrains, e.g. PHPStorm) pick it up just fine for syntax highlighting.

dan2k3k4 avatar Aug 31 '21 17:08 dan2k3k4

@dan2k3k4 great! And there is no issue to deploy images in this way on Kubernetes?

ThomasLohmann avatar Aug 31 '21 17:08 ThomasLohmann

@ThomasLohmann nope, uselagoon/lagoon-images repository is done this way too and that hosts several thousand different websites including the Australian government.

dan2k3k4 avatar Aug 31 '21 17:08 dan2k3k4

@dan2k3k4 perfect!

Let's hope that docker will support purpose.dockerfile instead of purpose.Dockerfile soon. Or even just purpose.docker. It would then be more like a real file extension.

ThomasLohmann avatar Aug 31 '21 18:08 ThomasLohmann

The capitalisation doesn't matter. We use lowercase d in our images but the Lagoon repo is using uppercase, I think just for clarity.

dan2k3k4 avatar Aug 31 '21 18:08 dan2k3k4

Thanks for the pull request. We'd like to make our product docs better, but haven’t been able to review all the suggestions. As our docs have also diverged, we do not have the bandwidth to review and rebase old pull requests.

If the updates are still relevant, review our contribution guidelines and rebase your pull request against the latest version of the docs, then mark it as fresh with a /remove-lifecycle stale comment. If not, this pull request will be closed in 30 days. This helps our maintainers focus on the active pull requests.

Prevent pull requests from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

docker-robott avatar Nov 27 '22 01:11 docker-robott