I'm packaging and shipping a custom code base of Wordpress with a Dockerfile in to my private container registry.
Dockerfile:
FROM wordpress:latest
ADD . /var/www/html
Then on the deployment server I just use docker-compose.yml
and grab my custom image.
and also I'm mounting this needed directory to host.
docker-compose.yml
volumes:
- .:/var/www/html
Container starts and runs without any hustle. However the problem is the code (files, directories) I ported earlier doesn't show on the deployment. Only the official wordpress:latest
data are there.
What I'm missing here?
Another try
Then I tried something like this. Instead of directly ADD . /var/www/html/
, I copied code base to another directory ADD . /app
on build and on the deployment docker-compose.yml, I tried to cp -a /app/. /var/www/html
with a command
parameter. Command and cp
works. However it happens before wordpress:latest
script runs and it avoid coping official wordpress files, which I don't want. I expect some official files from wordpress:latest
to be copied to the /var/www/html/
then my customer data to be copied from /app
Whats the missing ingredient here?
However in that case
/var/www/html
is copied when bundling my custom image, when mounting/var/www/html
to current directory should show my above bundled files and dirs. For the latter issue. I was adding my customENTRYPOINT
on the buildDockerfile
which is wrong and it keeps thewordpress:latest
ENRTYPOINT and CMD not running. – inckka Sep 18 '18 at 7:23