Correct way to update with Docker Compose?
2600box opened this issue · 0 comments
Hello, is there a special way to update monica with docker compose?
Normally I use WatchTower to do this automatically. However for monica I get the following error:
DEBU[0004] Trying to load authentication credentials. container=/monica-app-1 image="monica-app:latest"
DEBU[0004] No credentials for monica-app:latest found config_file=/config.json
DEBU[0004] Got image name: monica-app:latest
DEBU[0004] Checking if pull is needed container=/monica-app-1 image="monica-app:latest"
DEBU[0004] Building challenge URL URL="https://index.docker.io/v2/"
DEBU[0004] Got response to challenge request header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
DEBU[0004] Checking challenge header content realm="https://auth.docker.io/token" service=registry.docker.io
DEBU[0004] Setting scope for auth token image=monica-app scope="repository:library/monica-app:pull"
DEBU[0004] No credentials found.
DEBU[0005] Parsing image ref host=index.docker.io image=monica-app normalized="docker.io/library/monica-app:latest" tag=latest
DEBU[0005] Doing a HEAD request to fetch a digest url="https://index.docker.io/v2/library/monica-app/manifests/latest"
WARN[0005] Could not do a head request for "monica-app:latest", falling back to regular pull. container=/monica-app-1 image="monica-app:latest"
WARN[0005] Reason: registry responded to head request with "401 Unauthorized", auth: "Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\",scope=\"repository:library/monica-app:pull\",error=\"insufficient_scope\"" container=/monica-app-1 image="monica-app:latest"
DEBU[0005] Pulling image container=/monica-app-1 image="monica-app:latest"
DEBU[0006] Error pulling image monica-app:latest, Error response from daemon: pull access denied for monica-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
INFO[0006] Unable to update container "/monica-app-1": Error response from daemon: pull access denied for monica-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. Proceeding to next.
DEBU[0006] Trying to load authentication credentials. container=/monica-db-1 image="mysql:5.7"
DEBU[0006] No credentials for mysql:5.7 found config_file=/config.json
DEBU[0006] Got image name: mysql:5.7
DEBU[0006] Checking if pull is needed container=/monica-db-1 image="mysql:5.7"
DEBU[0006] Building challenge URL URL="https://index.docker.io/v2/"
DEBU[0006] Got response to challenge request header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
DEBU[0006] Checking challenge header content realm="https://auth.docker.io/token" service=registry.docker.io
DEBU[0006] Setting scope for auth token image=mysql scope="repository:library/mysql:pull"
DEBU[0006] No credentials found.
DEBU[0007] Parsing image ref host=index.docker.io image=mysql normalized="docker.io/library/mysql:5.7" tag=5.7
DEBU[0007] Doing a HEAD request to fetch a digest url="https://index.docker.io/v2/library/mysql/manifests/5.7"
DEBU[0007] Found a remote digest to compare with remote="sha256:f04fc2e2f01e65d6e2828b4cce2c4761d9258aee71d989e273b2ae309f44a945"
DEBU[0007] Comparing local="sha256:f04fc2e2f01e65d6e2828b4cce2c4761d9258aee71d989e273b2ae309f44a945" remote="sha256:f04fc2e2f01e65d6e2828b4cce2c4761d9258aee71d989e273b2ae309f44a945"
DEBU[0007] Found a match
DEBU[0007] No pull needed. Skipping image.
DEBU[0007] No new images found for /monica-db-```
If I try manually with `docker compose pull` I get the following error:
~/monica$ docker compose pull
[+] Running 1/2
⠿ app Warning 1.5s
⠿ db Pulled 1.3s
WARNING: Some service image(s) must be built from source by running:
docker compose build app
1 error occurred:
* Error response from daemon: pull access denied for monica-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
I can do `docker compose build app` but I am not sure if that is the correct way to update and it would be great if I could make it work with WatchTower?
Thanks!
version: "3.4"
services:
app:
build: ./app
image: monica-app
depends_on:
- db
env_file: .env
environment:
- DB_HOST=db
- DB_USERNAME=monica
- DB_PASSWORD=secret
ports:
- 8380:80
volumes:
- data:/var/www/html/storage
restart: always
db:
image: mysql:5.7
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=monica
- MYSQL_PASSWORD=secret
volumes:
- mysql:/var/lib/mysql
restart: always
volumes:
data:
mysql: