Hot answers tagged

5

I found the reason of the problem. In Docker "anything after the VOLUME instruction in a Dockerfile will not be able to make changes to that volume". I define volume "./app:/var/www/app", and after that manipulate with it, so it's not work.


2

An approach I use in both prod and dev is to run a webhook server ( this one is excellent https://github.com/adnanh/webhook ) which is subscribed to listen to the github.com git push events which are published by github ... then when someone does a push to github.com the webhook launches a rebuild script to issue git pull then recomple the code and issue ...


2

Your mkdir and chown commands are RUN when building the image, whereas you then mount /var/www/app from a VOLUME, so you are replacing the created and chowned folder with the contents of ./app on the outside (and thus it's as if the chown didn't work). If you want to chown the contents of the volume after it is mounted, you should place those instructions ...


1

It looks like that the docker login and the docker build were done by different users. If a docker login is performed, then a ~/.docker directory will be created in the namespace of user X, if the build is done by user Y then the latter user does not have a .docker folder and is not authorized to pull the image. One could verify this by echo $USER in the ...


1

What kind of technology do you use? Are you speaking about local deployment, during development phase? If you have some kind of "ng serve" feature like in Angular you can probably use volumes (bind mounts, to be specific) to bind your code on your host to the code inside your container. Then, every time you do a modification on your code, it will be updated ...


1

I would use a Packer template, specifically with a Docker builder to do this. Triggering this build can be done with hooks (either BitBucket webhooks, or git server post-receive hooks. Building a Docker image from a Packer template has some benefits, but requires Docker Engine installed - so, doing the build with a Dockerfile would also be an option. The ...


1

You are correct in that using localhost within the container is referencing the container, and not your network. You could use inspect, find the ip, and hardcode the ip. However, a simpler and cleaner solution would be to utilize Docker's network features. When you run the containers you can put the containers inside a defined network. Containers in this ...


Only top voted, non community-wiki answers of a minimum length are eligible