Cannot connect to the Docker daemon at unix:///var/run/docker.sock in Azure hosted multi-container Web App - azure

Using Azure Web Apps for Containers to spin up a docker-compose configuration. The primary proxy is Traefik which needs access to the docker API. The container start up correctly. But the traefik container can not access the docker API socket file.
The docker-compose settings for the volume of the traefik container is:
services:
traefik:
image: "traefik:v2.0"
[...]
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
[...]
The containers start up successfully with the following log:
2019-09-16 10:40:35.040 INFO - Pulling image from Docker hub:
library/traefik:v2.0 2019-09-16 10:40:35.589 INFO - v2.0 Pulling from
library/traefik 2019-09-16 10:40:35.810 INFO - Digest:
sha256:97c6da99b265de1c50e866ff66f927abb84659dcb7916c33e17623fc6969551c
2019-09-16 10:40:35.816 INFO - Status: Image is up to date for
traefik:v2.0 2019-09-16 10:40:35.835 INFO - Pull Image successful,
Time taken: 0 Minutes and 0 Seconds 2019-09-16 10:40:35.871 INFO -
Starting container for site 2019-09-16 10:40:35.872 INFO - docker run
-d -p 40317:80 --name containertest3_traefik_1_6d1c6629 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e
WEBSITE_SITE_NAME=containertest3 -e WEBSITE_AUTH_ENABLED=False -e
WEBSITE_ROLE_INSTANCE_ID=0 -e
WEBSITE_HOSTNAME=containertest3.azurewebsites.net -e
WEBSITE_INSTANCE_ID=902eae0c51eb407ec9308de2a1c3fce2b35f53f6d148e328560acba2560930f0
-e HTTP_LOGGING_ENABLED=1 traefik:v2.0 --api.insecure=true --providers.docker=true --providers.docker.exposedbydefault=false --entrypoints.web.address=:80 --entryPoints.web.forwardedHeaders.insecure
2019-09-16 10:40:36.215 INFO - Pulling image from Docker hub:
containous/whoami 2019-09-16 10:40:36.779 INFO - latest Pulling from
containous/whoami 2019-09-16 10:40:36.780 INFO - Digest:
sha256:09229ae40edb92e95b15e90fef46bfadab14fd1ec2232aca717a501741fcf391
2019-09-16 10:40:36.788 INFO - Status: Image is up to date for
containous/whoami:latest 2019-09-16 10:40:36.790 INFO - Pull Image
successful, Time taken: 0 Minutes and 0 Seconds 2019-09-16
10:40:36.815 INFO - Starting container for site 2019-09-16
10:40:36.816 INFO - docker run -d -p 0:80 --name
containertest3_whoami_1_6d1c6629 -e
WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e
WEBSITE_SITE_NAME=containertest3 -e WEBSITE_AUTH_ENABLED=False -e
WEBSITE_ROLE_INSTANCE_ID=0 -e
WEBSITE_HOSTNAME=containertest3.azurewebsites.net -e
WEBSITE_INSTANCE_ID=902eae0c51eb407ec9308de2a1c3fce2b35f53f6d148e328560acba2560930f0
-e HTTP_LOGGING_ENABLED=1 containous/whoami
2019-09-16 10:40:47.048 INFO - Started multi-container app 2019-09-16
10:40:47.099 INFO - Initiating warmup request to container
containertest3_traefik_1_6d1c6629 for site containertest3 2019-09-16
10:40:47.101 INFO - Container containertest3_traefik_1_6d1c6629 for
site containertest3 initialized successfully and is ready to serve
requests.
However, in the error logs, Traefik can not acces the docker api and therefore does not work correctly:
2019-09-16T10:40:47.505909459Z time="2019-09-16T10:40:47Z" level=error
msg="Provider connection error Cannot connect to the Docker daemon at
unix:///var/run/docker.sock. Is the docker daemon running?, retrying
in 1.080381816s" providerName=docker
2019-09-16T10:40:48.585335458Z time="2019-09-16T10:40:48Z" level=error
msg="Failed to retrieve information of the docker client and server
host: Cannot connect to the Docker daemon at
unix:///var/run/docker.sock. Is the docker daemon running?"
Final error for the Traefik container:
"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
Any idea how to fix this error in the Azure app environment? Is this not possible within the Azure hosting/preview for App containers?

The Azure Web App service does not allow for reading from docker.sock.
You need to use another configuration provider in traefik if you want to run multi-container in Azure App Service.

Related

Deploying a multi-container app on Azure App Services

I have been struggling for some days now to deploy an Azure App Service with two minimalist Docker containers.
My first image is a basic PostgreSQL image and my second image is built with the following Dockerfile:
FROM python:3.7
RUN pip install streamlit
COPY app.py /streamlit-docker/
WORKDIR /streamlit-docker/
CMD streamlit run app.py
and where app.py is:
import streamlit as st
st.write('Hello world')
The docker-compose.yml file I use for creating my Azure App service is the following:
version: '3.3'
services:
db:
image: atestcr.azurecr.io/postgres:latest
environment:
POSTGRES_PASSWORD: postgres
app:
image: atestcr.azurecr.io/my_app:latest
ports:
- '8501:8501'
I get an 'Application Error' whenever I try to access the webapp URL. However, when I deploy this app with a single docker container, using this docker-compose.yml:
version: '3.3'
services:
app:
image: atestcr.azurecr.io/my_app:latest
ports:
- '8501:8501'
everything works fine.
Here is a GitHub repo to recreate the bug.
These are the Azure logs:
2021-08-09T17:29:34.382Z INFO - Starting multi-container app..
2021-08-09T17:29:35.089Z INFO - Pulling image: atestcr.azurecr.io/postgres:latest
2021-08-09T17:29:35.313Z INFO - latest Pulling from postgres
2021-08-09T17:29:35.315Z INFO - Digest: sha256:b6df1345afa5990ea32866e5c331eefbf2e30a05f2a715c3a9691a6cb18fa253
2021-08-09T17:29:35.317Z INFO - Status: Image is up to date for atestcr.azurecr.io/postgres:latest
2021-08-09T17:29:35.319Z INFO - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2021-08-09T17:29:35.335Z INFO - Starting container for site
2021-08-09T17:29:35.335Z INFO - docker run -d -p 8477:5432 --name testapp32_db_0_6662435d -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=testapp32 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=testapp32.azurewebsites.net -e WEBSITE_INSTANCE_ID=42c09ff46e6c54cb467d28e88f2ab5b1e8971ee4daf2e883f44401bde67fe89f -e HTTP_LOGGING_ENABLED=1 atestcr.azurecr.io/postgres:latest
2021-08-09T17:29:35.781Z INFO - Pulling image: atestcr.azurecr.io/my_app:latest
2021-08-09T17:29:35.984Z INFO - latest Pulling from my_app
2021-08-09T17:29:35.987Z INFO - Digest: sha256:659937a52a6223b938b3d429901ab8648497870bf8068b5dcc05816050db5eaf
2021-08-09T17:29:35.988Z INFO - Status: Image is up to date for atestcr.azurecr.io/my_app:latest
2021-08-09T17:29:35.993Z INFO - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2021-08-09T17:29:36.014Z INFO - Starting container for site
2021-08-09T17:29:36.014Z INFO - docker run -d -p 0:8501 --name testapp32_app_0_6662435d -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=testapp32 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=testapp32.azurewebsites.net -e WEBSITE_INSTANCE_ID=42c09ff46e6c54cb467d28e88f2ab5b1e8971ee4daf2e883f44401bde67fe89f -e HTTP_LOGGING_ENABLED=1 atestcr.azurecr.io/my_app:latest
2021-08-09T17:33:26.741Z ERROR - multi-container unit was not started successfully
2021-08-09T17:33:26.846Z INFO - Container logs from testapp32_db_0_6662435d = 2021-08-09T17:29:40.459721366Z The files belonging to this database system will be owned by user "postgres".
2021-08-09T17:29:40.491740899Z This user must also own the server process.
2021-08-09T17:29:40.493019808Z
2021-08-09T17:29:40.497263739Z The database cluster will be initialized with locale "en_US.utf8".
2021-08-09T17:29:40.502456876Z The default database encoding has accordingly been set to "UTF8".
2021-08-09T17:29:40.503203182Z The default text search configuration will be set to "english".
2021-08-09T17:29:40.503218482Z
2021-08-09T17:29:40.503223282Z Data page checksums are disabled.
2021-08-09T17:29:40.506809008Z
2021-08-09T17:29:40.521275113Z fixing permissions on existing directory /var/lib/postgresql/data ... ok
2021-08-09T17:29:40.523912632Z creating subdirectories ... ok
2021-08-09T17:29:40.525237242Z selecting dynamic shared memory implementation ... posix
2021-08-09T17:29:40.642905697Z selecting default max_connections ... 100
2021-08-09T17:29:40.733900958Z selecting default shared_buffers ... 128MB
2021-08-09T17:29:41.039050775Z selecting default time zone ... Etc/UTC
2021-08-09T17:29:41.047757638Z creating configuration files ... ok
2021-08-09T17:29:44.416903507Z running bootstrap script ... ok
2021-08-09T17:29:50.023628737Z performing post-bootstrap initialization ... ok
2021-08-09T17:30:04.217544961Z syncing data to disk ... ok
2021-08-09T17:30:04.218321267Z
2021-08-09T17:30:04.219189873Z initdb: warning: enabling "trust" authentication for local connections
2021-08-09T17:30:04.219206473Z You can change this by editing pg_hba.conf or using the option -A, or
2021-08-09T17:30:04.219223973Z --auth-local and --auth-host, the next time you run initdb.
2021-08-09T17:30:04.219491175Z
2021-08-09T17:30:04.219513275Z Success. You can now start the database server using:
2021-08-09T17:30:04.219519575Z
2021-08-09T17:30:04.219523675Z pg_ctl -D /var/lib/postgresql/data -l logfile start
2021-08-09T17:30:04.219527775Z
2021-08-09T17:30:08.340584036Z waiting for server to start.......2021-08-09 17:30:08.340 UTC [44] LOG: starting PostgreSQL 13.3 (Debian 13.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-08-09T17:30:08.478247580Z 2021-08-09 17:30:08.410 UTC [44] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-08-09T17:30:08.680599067Z 2021-08-09 17:30:08.680 UTC [45] LOG: database system was shut down at 2021-08-09 17:29:49 UTC
2021-08-09T17:30:08.753589768Z 2021-08-09 17:30:08.753 UTC [44] LOG: database system is ready to accept connections
2021-08-09T17:30:08.755965684Z done
2021-08-09T17:30:08.760382514Z server started
2021-08-09T17:30:09.790821978Z
2021-08-09T17:30:09.799723839Z /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2021-08-09T17:30:09.802079455Z
2021-08-09T17:30:09.840304817Z 2021-08-09 17:30:09.834 UTC [44] LOG: received fast shutdown request
2021-08-09T17:30:09.862102366Z waiting for server to shut down....2021-08-09 17:30:09.861 UTC [44] LOG: aborting any active transactions
2021-08-09T17:30:09.950488072Z 2021-08-09 17:30:09.950 UTC [44] LOG: background worker "logical replication launcher" (PID 51) exited with exit code 1
2021-08-09T17:30:09.954360498Z 2021-08-09 17:30:09.950 UTC [46] LOG: shutting down
2021-08-09T17:30:13.063848848Z ...2021-08-09 17:30:13.063 UTC [44] LOG: database system is shut down
2021-08-09T17:30:13.138558463Z done
2021-08-09T17:30:13.140082774Z server stopped
2021-08-09T17:30:13.144102302Z
2021-08-09T17:30:13.162430928Z PostgreSQL init process complete; ready for start up.
2021-08-09T17:30:13.165654351Z
2021-08-09T17:30:14.083504086Z 2021-08-09 17:30:13.992 UTC [1] LOG: starting PostgreSQL 13.3 (Debian 13.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-08-09T17:30:14.084760295Z 2021-08-09 17:30:14.011 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-08-09T17:30:14.084774095Z 2021-08-09 17:30:14.015 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-08-09T17:30:14.084779495Z 2021-08-09 17:30:14.082 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-08-09T17:30:14.156076187Z 2021-08-09 17:30:14.132 UTC [63] LOG: database system was shut down at 2021-08-09 17:30:12 UTC
2021-08-09T17:30:14.198749982Z 2021-08-09 17:30:14.176 UTC [1] LOG: database system is ready to accept connections
2021-08-09T17:30:15.006882460Z 2021-08-09 17:30:14.998 UTC [70] LOG: invalid length of startup packet
2021-08-09T17:30:16.112919592Z 2021-08-09 17:30:16.112 UTC [71] LOG: invalid length of startup packet
2021-08-09T17:30:17.178350344Z 2021-08-09 17:30:17.174 UTC [72] LOG: invalid length of startup packet
...
2021-08-09T17:33:25.735293291Z 2021-08-09 17:33:25.735 UTC [260] LOG: invalid length of startup packet
2021-08-09T17:33:29.142Z INFO - Container logs from testapp32_app_0_6662435d = 2021-08-09T17:30:24.010212694Z
2021-08-09T17:30:24.011085300Z You can now view your Streamlit app in your browser.
2021-08-09T17:30:24.011101800Z
2021-08-09T17:30:24.012092107Z Network URL: http://172.16.232.3:8501
2021-08-09T17:30:24.012855612Z External URL: http://20.40.148.207:8501
2021-08-09T17:30:24.013407416Z
2021-08-09T17:33:36.002Z INFO - Stopping site testapp32 because it failed during startup.
It's worth noting your shared example doesn't work because your docker-compose.yml is using your own private container registries.
However, tinkering around the edges I have managed to get your dummy example working with changes to the following files:
Your app dockerfile:
FROM python:3.7
RUN pip install streamlit
COPY app.py /streamlit-docker/
WORKDIR /streamlit-docker/
EXPOSE 80
CMD streamlit run app.py --server.port 80
And adjusting your docker-compose.yml
version: '3.3'
services:
db:
image: postgis/postgis:13-master
environment:
- POSTGRES_DB=counterfactualcovid
- POSTGRES_USER=django
- POSTGRES_PASSWORD=django
app:
image: testazurecontainerregistryajc.azurecr.io/mcmegaapp:latest
ports:
- '80:80'
Ignore the fact i've used a generic postgres docker image and my own private container registry for the images and you'll see the key changes are:
in the Dockerfile exposing port 80, and adding --server.port 80 to the streamlit CMD call
in the docker-compose.yml setting the port forwarding to 80:80
I /think/ your issues arise from the preview limitations for the multi-container web apps feature, so setting everything to work via port 80 appears to resolve this.

Problem executing "minikube start" command

malik#malik:~$ minikube start
😄 minikube v1.12.0 on Ubuntu 18.04
✨ Using the docker driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🎉 minikube 1.12.1 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.12.1
💡 To disable this notice, run: 'minikube config set WantUpdateNotification false'
🚜 Pulling base image ...
💾 Downloading Kubernetes v1.18.3 preload ...
E0727 07:25:35.757871 14015 cache.go:63] save image to file "k8s.gcr.io/kube-apiserver:v1.18.3" -> "/home/malik/.minikube/cache/images/k8s.gcr.io/kube-apiserver_v1.18.3" failed: write: Get https://k8s.gcr.io/v2/kube-apiserver/blobs/sha256:83b4483280e5187b2801b449338d5755e5874ab80c44bf1ce615d258142e7c8b: dial tcp: lookup k8s.gcr.io: no such host
E0727 07:25:35.757643 14015 cache.go:63] save image to file "k8s.gcr.io/coredns:1.6.7" -> "/home/malik/.minikube/cache/images/k8s.gcr.io/coredns_1.6.7" failed: write: Get https://k8s.gcr.io/v2/coredns/blobs/sha256:c6568d217a0023041ef9f729e8836b19f863bcdb612bb3a329ebc165539f5a80: dial tcp: lookup k8s.gcr.io: no such host
E0727 07:25:35.757512 14015 cache.go:63] save image to file "k8s.gcr.io/kube-scheduler:v1.18.3" -> "/home/malik/.minikube/cache/images/k8s.gcr.io/kube-scheduler_v1.18.3" failed: write: Get https://k8s.gcr.io/v2/kube-scheduler/blobs/sha256:83b4483280e5187b2801b449338d5755e5874ab80c44bf1ce615d258142e7c8b: dial tcp: lookup k8s.gcr.io: no such host
E0727 07:26:22.529729 14015 cache.go:63] save image to file "kubernetesui/dashboard:v2.0.1" -> "/home/malik/.minikube/cache/images/kubernetesui/dashboard_v2.0.1" failed: nil image for kubernetesui/dashboard:v2.0.1: Get https://index.docker.io/v2/: dial tcp: lookup index.docker.io: no such host
E0727 07:26:22.544151 14015 cache.go:63] save image to file "kubernetesui/metrics-scraper:v1.0.4" -> "/home/malik/.minikube/cache/images/kubernetesui/metrics-scraper_v1.0.4" failed: nil image for kubernetesui/metrics-scraper:v1.0.4: Get https://index.docker.io/v2/: dial tcp: lookup index.docker.io: no such host
E0727 07:26:22.579102 14015 cache.go:63] save image to file "k8s.gcr.io/etcd:3.4.3-0" -> "/home/malik/.minikube/cache/images/k8s.gcr.io/etcd_3.4.3-0" failed: write: error calculating manifest: Get https://storage.googleapis.com/eu.artifacts.k8s-artifacts-prod.appspot.com/containers/images/sha256:303ce5db0e90dab1c5728ec70d21091201a23cdf8aeca70ab54943bbaaf0833f: dial tcp: lookup storage.googleapis.com: no such host
E0727 07:26:22.579102 14015 cache.go:63] save image to file "k8s.gcr.io/kube-controller-manager:v1.18.3" -> "/home/malik/.minikube/cache/images/k8s.gcr.io/kube-controller-manager_v1.18.3" failed: write: error calculating manifest: Get https://storage.googleapis.com/eu.artifacts.k8s-artifacts-prod.appspot.com/containers/images/sha256:da26705ccb4b5eb623a7cc42e566d21b0e23c1f59a0b4d6acac3fb810538c0d5: dial tcp: lookup storage.googleapis.com: no such host
E0727 07:26:22.579194 14015 cache.go:63] save image to file "k8s.gcr.io/kube-proxy:v1.18.3" -> "/home/malik/.minikube/cache/images/k8s.gcr.io/kube-proxy_v1.18.3" failed: write: error calculating manifest: Get https://storage.googleapis.com/eu.artifacts.k8s-artifacts-prod.appspot.com/containers/images/sha256:3439b7546f29bec22edd737bc0a5770ead18b5ee5ce0aea5af9047a554715f9f: dial tcp: lookup storage.googleapis.com: no such host
E0727 07:26:22.579229 14015 cache.go:63] save image to file "gcr.io/k8s-minikube/storage-provisioner:v1.8.1" -> "/home/malik/.minikube/cache/images/gcr.io/k8s-minikube/storage-provisioner_v1.8.1" failed: write: error calculating manifest: Get https://storage.googleapis.com/artifacts.k8s-minikube.appspot.com/containers/images/sha256:4689081edb103a9e8174bf23a255bfbe0b2d9ed82edc907abab6989d1c60f02c: dial tcp: lookup storage.googleapis.com: no such host
E0727 07:26:22.619544 14015 cache.go:172] Error downloading kic artifacts: failed to download kic base image or any fallback image
❗ Executing "docker container inspect minikube --format={{.State.Status}}" took an unusually long time: 5.369799649s
💡 Restarting the docker service may improve performance.
🤷 docker "minikube" container is missing, will recreate.
🔥 Creating docker container (CPUs=2, Memory=2200MB) ...
🤦 StartHost failed, but will try again: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --security-opt apparmor=unconfined --cpus=2 --memory=2200mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 gcr.io/k8s-minikube/kicbase:v0.0.10#sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438: exit status 125
stdout:
stderr:
Unable to find image 'gcr.io/k8s-minikube/kicbase:v0.0.10#sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438' locally
docker: Error response from daemon: Get https://gcr.io/v2/k8s-minikube/kicbase/manifests/sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438: Get https://gcr.io/v2/token?scope=repository%3Ak8s-minikube%2Fkicbase%3Apull&service=gcr.io: net/http: request canceled (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
🤷 docker "minikube" container is missing, will recreate.
🔥 Creating docker container (CPUs=2, Memory=2200MB) ...
😿 Failed to start docker container. "minikube start" may fix it: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --security-opt apparmor=unconfined --cpus=2 --memory=2200mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 gcr.io/k8s-minikube/kicbase:v0.0.10#sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438: exit status 125
stdout:
stderr:
Unable to find image 'gcr.io/k8s-minikube/kicbase:v0.0.10#sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438' locally
docker: Error response from daemon: Get https://gcr.io/v2/: dial tcp: lookup gcr.io: no such host.
See 'docker run --help'.
❌ [INVALID_PROXY_HOSTNAME] error provisioning host Failed to start host: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --security-opt apparmor=unconfined --cpus=2 --memory=2200mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 gcr.io/k8s-minikube/kicbase:v0.0.10#sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438: exit status 125
stdout:
stderr:
Unable to find image 'gcr.io/k8s-minikube/kicbase:v0.0.10#sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438' locally
docker: Error response from daemon: Get https://gcr.io/v2/: dial tcp: lookup gcr.io: no such host.
See 'docker run --help'.
💡 Suggestion: Verify that your HTTP_PROXY and HTTPS_PROXY environment variables are set correctly.
📘 Documentation: https://minikube.sigs.k8s.io/docs/handbook/vpn_and_proxy/
When I run the "minikube start" command the Docker fails to load the images that are needed as it is being used as the virtual machine manager by Minikube and Kubectl is providing the interface for Minikube to be used on the terminal. I executed commands and operations using the Virtualbox as well but no use. The version of Docker, Kubectl & Minikube is up-to-date.
I have tried installing Minikube and Kubectl several times using different packages and methods but useless
Please help me so that I can be able to start a cluster and make my PC a Worker Node and get going on the road of Cloud Computing Development
You might have a minikube VM that has an old version or/and minikube cannot connect to. You can try deleting the VM and/or wipe out ~/.minikube
$ minikube delete
$ rm -rf ~/.minikube
If that doesn't work then you have a problem with VirtualBox. Uninstall/Re-install
3 years ago, I spent a lot of time struggling with minikube even though it has been the official way to run kubernetes locally.
If you get stuck, i would suggest to have a KinD cluster up in few seconds by just running this script:
kind_version="v0.8.1"
kind_bin_path=/usr/local/bin/kind
if [ ! -f ${kind_bin_path} ]; then
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/${kind_version}/kind-$(uname)-amd64"
chmod +x ./kind
sudo mv ./kind ${kind_bin_path}
fi
cat <<EOF | kind create cluster --config -
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
EOF
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
# Now check
kubectl get nodes
# Congrats!
To customize more the cluster, check other YAML config here.
Good luck for whatever works for you.

Docker container startup hangs while trying to run voting app

I did the following:
https://github.com/dockersamples/example-voting-app
cd example-voting-app
Inside that there are number of files/folders
MAINTAINERS
LICENSE
Jenkinsfile
ExampleVotingApp.sln
README.md
docker-stack-windows-1809.yml
docker-stack-simple.yml
docker-compose.yml
docker-compose-windows.yml
docker-compose-windows-1809.yml
docker-compose-simple.yml
docker-compose-k8s.yml
docker-compose-javaworker.yml
architecture.png
kube-deployment.yml
k8s-specifications
docker-stack.yml
docker-stack-windows.yml
result
vote
worker
I did cd vote and executed following commands
docker build . -t voting-app
docker run -p 5000:80 voting-app
After I run docker run command, I see the following output, and nothing is happening . I am clueless, as there is no error messages etc.
[root#osboxes vote]# docker run -p 5000:80 voting-app
[2020-06-16 17:59:27 +0000] [1] [INFO] Starting gunicorn 19.10.0
[2020-06-16 17:59:27 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
[2020-06-16 17:59:27 +0000] [1] [INFO] Using worker: sync
[2020-06-16 17:59:27 +0000] [9] [INFO] Booting worker with pid: 9
[2020-06-16 17:59:27 +0000] [10] [INFO] Booting worker with pid: 10
[2020-06-16 17:59:27 +0000] [11] [INFO] Booting worker with pid: 11
[2020-06-16 17:59:27 +0000] [12] [INFO] Booting worker with pid: 12
Please guide how to fix this issue, and how to get the vote app running on container.
My OS details are as follows:
NAME="CentOS Linux"
VERSION="7 (Core)"
Thanks
In my earlier answer, i got the app working, by building and running each image individually.
Finally, after spending few hours, I am finally able to create docker-compose.yml file and able to run the entire application using the following command:
docker-compose up
Hope it helps other who are struggling to make this application work.
docker-compose.yml
version: "3"
services:
redis:
image: redis
db:
image: postgres:9.4
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
vote:
image: voting-app
ports:
- 5000:80
links:
- redis
worker:
image: worker-app
links:
- db
- redis
result:
image: result-app
ports:
- 5001:80
links:
- db
After code checkout, I followed the following steps, and got the voting application to run.
change to vote directory
docker run -d --name=redis redis
docker build . -t voting-app
docker run -p 5000:80 --link redis:redis voting-app
docker run -d --name=db -e POSTGRES_PASSWORD=postgres postgres:9.4
change to worker directory
docker build . -t worker-app
docker run --link redis:redis --link db:db worker-app
change to result directory
docker build . -t result-app
docker run -p 5001:80 --link db:db result-app
Access the URLs
http://<IP>:5000/
http://<IP>:5001/
Replace the IP with IP of your machine. Now I can access both the URLs.

Cannot bring down hyperledger-fabric started sample networks - permission denied

I followed instructions, given in: edx.courses (LinuxFoundationX: LFS171x Blockchain for Business - An Introduction to Hyperledger Technologies),
which is similar to to official guide of hlf (https://hyperledger-fabric.readthedocs.io/en/release-1.1/build_network.html).
Snaped Image: Ubuntu18.04 #VMware Workstation (Host: Win10)
Most interesting parts:
$ curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0
$ export PATH=$PWD/bin:$PATH
$ git clone https://github.com/hyperledger/fabric-samples.git
$ cd fabric-samples/first-network
$ ./byfn.sh -m generate
$ ./byfn.sh -m up
========= All GOOD, BYFN execution completed ===========
_____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/
Now network is up and working. So, let's bring it down without changes:
t1#ubuntu:~/fabric-samples/first-network$ ./byfn.sh -m down
Stopping with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n]
proceeding ...
Stopping cli ... error
Stopping peer1.org1.example.com ... error
Stopping peer1.org2.example.com ... error
Stopping peer0.org2.example.com ... error
Stopping peer0.org1.example.com ... error
Stopping orderer.example.com ... error
ERROR: for cli cannot stop container: 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: Cannot kill container 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:387: signaling init process caused "permission denied"
: unknown
Removing network net_byfn
ERROR: error while removing network: network net_byfn id d75ceca2566ded50e7e9a2dce912e54df9b6d243baa8b7e2dade3f72da5d3815 has active endpoints
Stopping cli ... error
Stopping peer1.org1.example.com ... error
Stopping peer1.org2.example.com ... error
Stopping peer0.org2.example.com ... error
Stopping peer0.org1.example.com ... error
Stopping orderer.example.com ... error
ERROR: for cli cannot stop container: 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: Cannot kill container 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:387: signaling init process caused "permission denied"
: unknown
Removing network net_byfn
ERROR: error while removing network: network net_byfn id
Troubleshooting
$ docker rmi -f $(docker images -q)
Will not work:
Deleted: sha256:fd96d34cdd7035e9d7c4fdf4dae4e9c8d4a2e9a5f082a13043bafb5109992a0a
Deleted: sha256:809c70fab2ffe494878efb5afda03b2aaeda26a6113428f1a9a907a800c3bbb7
Deleted: sha256:833649a3e04c96faf218d8082b3533fa0674664f4b361c93cad91cf97222b733
Error response from daemon: conflict: unable to delete be773bfc074c (cannot be forced) - image is being used by running container 546cfd593673
Error response from daemon: conflict: unable to delete 0592b563eec8 (cannot be forced) - image is being used by running container d36402eba8e7
Error response from daemon: conflict: unable to delete 4460ed7ada01 (cannot be forced) - image is being used by running container 6247fdfca8f2
Error: No such image: 72617b4fa9b4
Error response from daemon: conflict: unable to delete b7bfddf508bc (cannot be forced) - image is being used by running container 743f05760adc
Error response from daemon: conflict: unable to delete b7bfddf508bc (cannot be forced) - image is being used by running container 743f05760adc
Error response from daemon: conflict: unable to delete ce0c810df36a (cannot be forced) - image is being used by running container 2314bf8b86b0
Error response from daemon: conflict: unable to delete ce0c810df36a (cannot be forced) - image is being used by running container 2314bf8b86b0
Error response from daemon: conflict: unable to delete b023f9be0771 (cannot be forced) - image is being used by running container 98307e956bd5
Error response from daemon: conflict: unable to delete b023f9be0771 (cannot be forced) - image is being used by running container 541ff05a7925
Error: No such image: 82098abb1a17
Error: No such image: c8b4909d8d46
Error: No such image: 92cbb952b6f8
Error: No such image: 554c591b86a8
Error: No such image: 7e73c828fc5b
Error response from daemon: conflict: unable to delete 220e5cf3fb7f (cannot be forced) - image has dependent child images
Thx for ur support.
(is my first post here, hope it's all fine for your expectation.)
First, deleting the images using docker rmi -f $(docker images -q) won't work, because you have unterminated containers using those images.
The ./byfn.sh -m down script tried to stop the containers spawn by fabriq but there was an error as you can see in the log: signaling init process caused "permission denied": unknown.
The cause of this error is usually AppArmor, try to run:
sudo aa-remove-unknown
and/or to stop the AppArmor service using:
sudo service apparmor stop
sudo update-rc.d -f apparmor remove
Try running below set of command's one by one, it will help you to clean docker containers so you can start fresh
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker volume prune
docker network prune
Note: This wont remove Hyperledger images so no need to worry about reinstalling anything
The same problem in case of Linux Ubuntu:
$sudo systemctl daemon-reload
$sudo systemctl restart docker
$docker ps -qa|xargs docker rm

Unable to run byfn.sh up

I'm trying to run Hyperledger Fabric's byfn on Amazon lightsail instances. I have ran the following launch script:
curl -o lightsail-compose.sh https://raw.githubusercontent.com/KY-Leung/Catena/master/setup/lightsail-compose.sh
chmod +x ./lightsail-compose.sh
./lightsail-compose.sh
curl -o /fabric-setup.sh https://raw.githubusercontent.com/KY-Leung/Catena/master/setup/fabric-setup.sh
chmod +x ./fabric-setup.sh
Subsequently, I SSH-ed into the isntance and executed the follwing:
/fabric-setup.sh
cd fabric-samples/first-network/
./byfn.sh generate
./byfn.sh up
However, the following error occured:
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
LOCAL_VERSION=1.4.0
DOCKER_IMAGE_VERSION=1.4.0
Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
Creating peer1.org2.example.com ...
Creating peer0.org1.example.com ...
Creating orderer.example.com ...
Creating peer1.org1.example.com ...
Creating peer0.org2.example.com ...
./byfn.sh: line 151: 9978 Killed IMAGE_TAG=$IMAGETAG docker-compose -f $COMPOSE_FILE up -d 2>&1
ERROR !!!! Unable to start network
I tried to google but to no avail. Any help is appreciated. Thanks!
Following are the versions:
Docker version 18.09.3, build 774a1f4
docker-compose version 1.23.2, build 1110ad01

Resources