I am using Docker, but not Swarm. I found out that there is a way to use docker secrets without Swarm as mentioned here or at the official documentation.
But this is just throwing errors. When I run docker-compose up -d I get this:
Command 'docker-compose' not found, but can be installed with: sudo apt install docker-compose
the error message you shared indicates that docker-compose is not installed and suggest the command to install it. Did you try to follow the suggestion?
Recent versions of the docker-cli support cli-plugins. On Ubuntu the cli-plugin for compose should be automaticaly installed (If I remember as docker-ce recommendation). Try to execute docker compose version, if it returns a version string, you can use docker compose instead of docker-compose.
Your compose file has wrong indentation. This is the correct indentation for the elements you used:
you can remove the version information, it became optional recently
you can even use the long syntax for secrets, which allows to define the target location inside the container and permission
This āsecretā is more or less the same as binding a read-only file into the container. A swarm secret on the other hand is stored encrypted in the swarm transaction log, which distributes it on all nodes. In both cases, Both share that the entrypoint script or the main application must know how to read the āsecretfileā from a container path, in order to have any functionality.
It works with some other images just fineā¦ Just a few minutes ago, I found out by accident that itās only working without - in between so docker compose instead of docker-composeā¦
(And following the suggestions did not work( try to install docker-compose with sudo apt install docker-compose)
Now everything is working fineā¦ But still strange i did a web test (HTML Website inside a container) and initialized it with docker-compose and it worksā¦
The other things you mentioned will take some time for me to understand because I just started with docker today and Iām not a native speaker
This is the Post that solved my Problemā¦ (In a different way, because I decided to āmigrateā to traefik instead of using a not "perfectly secured reverse proxy and also because it works in Kubernetes
How can i mark it as solution, there is no Button for me with solution on it
Itās not necessary to paraphrase the Postā¦ It just took some time for me to understand (Read it more than one time)
I believe you canāt do that in the āGeneral Discussionsā category since it is not for specific questions but discussions so you can like posts but you canāt mark them as solution. I moved the topic from General Discussions to the Open Source Projects / Compose category. Now you should be able to mark a post as solution.