I am trying to implement Watchtower which auto-build a container if any updates are found in Docker image.
These are commands I used for implementing watchtower:
git clone https://github.com/linuxacademy/content-express-demo-app.git watchtower
cd watchtower/
git checkout dockerfile
docker login -u "MYDOCKERREPO"
docker image build -t MYDOCKERREPO/my-express .
docker image push MYDOCKERREPO/my-express
docker container run -d --name watched-app -p 80:3000 --restart always MYDOCKERREPO/my-express
docker container run -d --name watchtower
--restart always
-v /var/run/docker.sock:/var/run/docker.sock
v2tec/watchtower -i 15
vi .dockerignore
Dockerfile
.git
.gitignore
#Added comment in app.js
created a sample.js file
docker image build -t MYDOCKERREPO/my-express --no-cache .
docker image push MYDOCKERREPO/my-express
I waited for many hours but no changes came. Also while pushing updated docker image it didn't show a single Pushed. All were saying 'Layers already exists"
Please if someone can help
EDIT:
Dockerfile:
FROM node
RUN mkdir -p /var/node
ADD . /var/node/
WORKDIR /var/node
RUN npm install
CMD ./bin/www