I am using Docker, but not Swarm (or any other orchestration) for a project.
Is there a way to leverage Docker Secrets without Swarm?
DevOps Stack Exchange is a question and answer site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure. It only takes a minute to sign up.Sign up to join this community
You can use docker secrets a bit differently using
docker-compose without having to use swarm. See this for the official documentation.
version: "3.7" services: db: image: mariadb:10.5.2 env_file: - ./db.env secrets: - rootpass - dbpass - mysqldb - mysqluser restart: always
secrets: rootpass: file: /tmp/root_pass dbpass: file: /tmp/db_pass mysqldb: file: /tmp/mysql_db mysqluser: file: /tmp/mysql_user
docker-compose up -d.
It's similar to how you define volumes and networks in a compose file.