Giter VIP home page Giter VIP logo

Comments (4)

sixeyed avatar sixeyed commented on May 29, 2024

Yes, you could do that - I take that same approach (using environment variables, but the same idea) in the bootstrap script in chapter 3. The other advantage is that the bootstrap script runs as admin so it has access to the secrets files, and you don't need to run the website in an elevated account (which is a limitation as of 17.06).

But I think there's a point where you need to decide if the benefits of the platform are worth investing in code changes, and secrets is one feature which I think is worth it.

If you use secure secret management outside of the container, but then persist the secret in plaintext inside the container, you're relying on the security of your app to keep it protected. If you use secrets as intended, then you can rely on the security of the platform.

from docker-on-windows.

artisticcheese avatar artisticcheese commented on May 29, 2024

Do you know if manually copying file into C:\ProgramData\docker\secrets\app-db.connectionstring inside DockerFile via Add command will be overwritten by file with the name when container will be run swarm mode? I think this will allow entire configuration be testable/debuggable in dev environment without need to resort for volume mapping and complex docker run commands. I will try to test it later but I thought you might know already if you tried it.
I think this might be the easiest way to introduce developers to containers without complexity of explaining of volume mapping etc. This way container can be run with straight up docker run without nothing else both in DEV and PRODUCTION with no code changes required. Just in production secrets location will be overwritten by swarm.

from docker-on-windows.

sixeyed avatar sixeyed commented on May 29, 2024

I haven't tried but I can't say I like that idea. With secrets you can build your app to be secure by default. If you provide an insecure mode, it should be explicit so you don't accidentally run it insecurely. To do that you just need Docker Compose files with different settings for dev and prod - it's simple but explicit (I describe that in my blog post on Windows Docker secrets).

from docker-on-windows.

artisticcheese avatar artisticcheese commented on May 29, 2024

I tried it. It does not work. Problem is that when you run this in swarm mode and docker tries to mount swarm secret in that location it fails since there is already a file there, so I went back to your method of environment variables and bootstrap file instead. Still not doing any sort of modifications to any other parts of the system though, just do all the transforms neccessary inside bootstrap.

from docker-on-windows.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.