Title. Just wondering if I did something bad/terrible with it. Link is @ title. Check the image tag @ its repo to see how it was built. And before someone asks… the Docker lemmy community is really dead so I had to resort to you guys. Sorry, I guess.

And thanks in advance.

  • dallen@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago

    Am I understanding correctly that you are building the image by copying in key elements from the host machine’s functioning nginx installation?

    This is creative but not common approach to docker.

    Normally software is installed following the officially documented procedure (imagine installing using apt or a shell script via RUN). Sometimes software documentation has specific recommendations to follow for containerized installs.

    It’s common to have the version defined as a variable where a change in value invalidates the docker layer cache. To me it’s unclear how caching would work with your dockerfile, for example, in the event of a upgrade. You could also see how a breaking change (such as one in the paths you are copying) could run into issues with your hardcoded approach.

    In the case of software like nginx, I would use the official image, mount config/cert files instead of copying, and extend in my own dockerfile if needed.

    • GustavoM@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      9 months ago

      copying in key elements from the host machine

      Not from the host machine, but from the official nginx image ( nginx:mainline-alpine3.18-slim ). And what it (basically) does is separate the essential commands/files inside a scratch image and gives every command a custom username tag.

      Still, I appreciate your input.