markriggins / dockerfy

Dockerfy your applications easily. Inject secrets and environment vars into config files. Reap Zombies. Wait for dependancies to become available. Run services inside your containers
Other
69 stars 7 forks source link

Error copying secrets file #5

Open sschimmel opened 7 years ago

sschimmel commented 7 years ago

When starting a container with dockerify in it I get the following error: dockerfy: 2017/03/31 10:54:56 Could not copy secrets files%!(EXTRA *os.PathError=mkdir /root/.secrets/: file exists)

I've tried an rm -rf on that folder as it's empty but that doesn't work.

The CMD in the Dockerfile is: ENTRYPOINT ["dockerfy", "--secrets-files", "/secrets/empty.env", "--start", "/bin/filebeat/filebeat -e -c /etc/filebeat/filebeat.yml", "--", "pm2-docker", "--json", "/opt/app/index.js"]. The /secrets/empty.env exists. I tried doing that to solve the error above but it didn't help.

The base image is node:6-alpine. Is it possible to have it not create the folder when it exists?

markriggins commented 7 years ago

The /root/.secrets directory should not already exist in a alpine image, unless you are creating it or mounting it. The best way to inject secrets into your image is via mount points, but mount them like this -v $HOME/.secrets:/secrets:ro

Dockerfy will read the secrets from the /secrets mount point within the container.

Do not copy secrets into the image with ADD or COPY. secrets should never be included in the image