How to store credentials in docker build secrets like docker secrets in docker swarm?

Currently, I’m using a Linux OS and having an issue with Docker build secrets, the credential file used for mounting still exists on the local machine during and after the build process.

I want to ask if there’s a way to store credentials similar to Docker secrets in Docker Swarm? or Do we have any way to protect the credential file on the local machine?

Here’s where I referenced the approach:

1 Like