Comments (7)
@thewinger In case you do not directly mount the docker.sock into the autoheal container you should provide an alternative method to reach the docker socket. If the alternative method is a socket proxy (via TCP connection) you should set the address of it in the DOCKER_SOCK environment variable. You added the socket_proxy network to the autoheal container on which the socket proxy container is located, this is good. So "you have to instruct" autoheal to use a TCP connection instead of direct docker socket access.
from docker-autoheal.
I tried to pair willfarrell/autoheal with tprasadtp/docker-socket-proxy, but found the same issue.
autoheal:
image: willfarrell/autoheal:latest
container_name: autoheal
depends_on:
- socketproxy
networks:
- socketproxynet
environment:
DOCKER_SOCK: tcp://socketproxy:2375
AUTOHEAL_INTERVAL: 5
AUTOHEAL_START_PERIOD: 0
AUTOHEAL_DEFAULT_STOP_TIMEOUT: 30
labels:
diun.enable: "true"
restart: unless-stopped
2020-12-07T07:36:27.214593318Z /docker-entrypoint: exec: line 101: autoheal: not found
Other containers (Watchtower, Diun, Portainer) works well with this companion.
@thewinger Have you added the DOCKER_SOCK environment variable instead of mounting the docker sock directly to your autoheal container?
from docker-autoheal.
@zhorvath83 have not tried to. I just wen with the default and used the
volume:
- /var/run/docker.sock:/var/run/docker.sock
from docker-autoheal.
I don't really have the knowledge to follow you up.
I tried adding
DOCKER_SOCK: tcp//socket-proxy:2375
but did not work.
from docker-autoheal.
@thewinger A colon is missing, otherwise everything is fine with it. It should look like this in your case:
In the autoheal docker container's compose you should include this:
environment:
DOCKER_SOCK: tcp://socket-proxy:2375
The next step is to configure the endpoint access rights on the socket proxy. For a test only, I allowed access to ALL endpoints (value 1) but it didn't worked. Ultimately, I am struggling with the same problem as you: autoheal doesen't starts in companion of socket proxy.
socketproxy:
container_name: socketproxy
image: ghcr.io/tprasadtp/docker-socket-proxy
networks:
- socketproxynet
privileged: true
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- LOG_LEVEL=debug
- EVENTS=1
- PING=1
- VERSION=1
- AUTH=1
- SECRETS=1
- POST=1
- DELETE=1
- BUILD=1
- COMMIT=1
- CONFIGS=1
- CONTAINERS=1
- DISTRIBUTION=1
- EXEC=1
- IMAGES=1
- INFO=1
- NETWORKS=1
- NODES=1
- PLUGINS=1
- SERVICES=1
- SESSION=1
- SWARM=1
- SYSTEM=1
- TASKS=1
- VOLUMES=1
- CONTAINERS_CREATE=1
- CONTAINERS_START=1
- CONTAINERS_UPDATE=1
- CONTAINERS_DELETE=1
- IMAGES_DELETE=1
labels:
diun.enable: "true"
restart: unless-stopped
Other containers (Watchtower, Diun, Portainer) works well with this companion.
from docker-autoheal.
Same issue here, is there a fix for this?
from docker-autoheal.
Here is a fix in two patches.
First patch add tcp support without ssl. Use tcp:// or tcps:// with DOCKER_SOCK.
Second patch fixes "not found" problem.
@ -10,7 +10,9 @@
# only use unix domain socket if no TCP endpoint is defined
case "${DOCKER_SOCK}" in
- "tcp://"*) HTTP_ENDPOINT="$(echo ${DOCKER_SOCK} | sed 's#tcp://#https://#')"
+ "tcp://"*) HTTP_ENDPOINT="$(echo ${DOCKER_SOCK} | sed 's#tcp://#http://#')"
+ ;;
+ "tcps://"*) HTTP_ENDPOINT="$(echo ${DOCKER_SOCK} | sed 's#tcps://#https://#')"
CA="--cacert /certs/ca.pem"
CLIENT_KEY="--key /certs/client-key.pem"
CLIENT_CERT="--cert /certs/client-cert.pem"
@ -64,7 +66,13 @@
# shellcheck disable=2039
trap 'kill $$; term_handler' SIGTERM
-if [ "$1" = "autoheal" ] && [ -e "$DOCKER_SOCK" ];then
+if [ "$1" = "autoheal" ]
+then
+ if [ -n "$UNIX_SOCK" ] && ! [ -S "$DOCKER_SOCK" ]
+ then
+ echo "Connection problem"
+ exit
+ fi
# Delayed startup
if [ "$AUTOHEAL_START_PERIOD" -gt 0 ]
then
from docker-autoheal.
Related Issues (20)
- Restart count? HOT 8
- WEBHOOK_URL
- Recreating container while restarting HOT 1
- How to send notifications to discord HOT 1
- "true" must be quoted in docker compose: documentation issue? HOT 2
- Restart Container failed 0- debugging, diagnosing? HOT 3
- Rework of alpine version tagging for docker images HOT 1
- Feature Request - Add custom text to webhook notifications HOT 1
- Optional Label not working
- Autoheal is healing ALL containers not just the ones with label HOT 3
- Feature/Question Notify Webhook also when container is restarting
- Possibility to exclude containers with a label? HOT 8
- segfault in ld-musl-x86_64.so.1 HOT 3
- **Feature Request** Restart Stack instead of just container HOT 6
- Vulnerabilities HOT 2
- Cannot stop Autoheal from restarting container..
- PWD services.yml
- WEBHOOK_URL for MS-TEAMS HOT 1
- Paused containers are restarted HOT 3
- Critical CVE detected on latest tag HOT 30
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-autoheal.