Reputation:
I want to extend the existing redis:6.0-alpine image from docker-hub and want to add my configuration file in the container.
For that I've created this dockerfile
FROM redis:6.0-alpine
WORKDIR .
COPY redis.master.conf ./config/redis.conf
but when building a container from this image, there is nothing copyed at the specified location.
Setup:
Some help ?
Upvotes: 0
Views: 781
Reputation: 12238
This is because WORKDIR
is set to .
in your dockerfile, which means current working directory. If you look at the official dockerfile of redis:6.0-alpine, the WORKDIR
is set to /data
.
Hence according to your dockerfile, you are copying the redis.master.conf
file to ./
which means /data
. Please check your file at /data/etc/redis.conf
. I tried this at my end and can confirm this behavior.
If you want to copy it at /etc/redis.conf
then remove ./
before /etc
.
Upvotes: 0
Reputation:
Just tested myself, and it's copied without issues.
Where are you trying to look for the file? Notice the entry directory of this image is not /
, it's /data
, hence your file is on /data/etc/redis.conf
Upvotes: 1