mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-03-23 00:05:28 +08:00
Fix docker issues
This commit is contained in:
parent
8f0cbfcd08
commit
2c4538354a
@ -83,4 +83,4 @@ Here's a sample compose yaml snippet for `linuxserver/docker-socket-proxy`:
|
||||
tmpfs:
|
||||
- /run
|
||||
```
|
||||
Then the env var in SWAG can be set as `DOCKER_HOST=tcp://socket-proxy:2375`. This will allow docker in SWAG to be able to start/stop existing containers, but it won't be allowed to spin up new containers.
|
||||
Then the env var in SWAG can be set as `DOCKER_HOST=socket-proxy`. This will allow SWAG to be able to start/stop existing containers, but it won't be allowed to spin up new containers.
|
||||
|
||||
@ -20,9 +20,16 @@ class ContainerThread(threading.Thread):
|
||||
self.daemon = True
|
||||
self.ondemand_containers = {}
|
||||
try:
|
||||
self.docker_client = docker.from_env()
|
||||
docker_host = os.environ.get("DOCKER_HOST", None)
|
||||
if docker_host:
|
||||
if not docker_host.startswith("tcp://"):
|
||||
docker_host = f"tcp://{docker_host}:2375"
|
||||
self.docker_client = docker.DockerClient(base_url=docker_host)
|
||||
else:
|
||||
self.docker_client = docker.from_env()
|
||||
except Exception as e:
|
||||
logging.exception(e)
|
||||
os._exit(1)
|
||||
|
||||
def process_containers(self):
|
||||
containers = self.docker_client.containers.list(all=True, filters={ "label": ["swag_ondemand=enable"] })
|
||||
|
||||
11
root/etc/s6-overlay/s6-rc.d/logrotate.d/ondemand
Normal file
11
root/etc/s6-overlay/s6-rc.d/logrotate.d/ondemand
Normal file
@ -0,0 +1,11 @@
|
||||
/config/log/ondemand/*.log {
|
||||
weekly
|
||||
rotate 14
|
||||
compress
|
||||
delaycompress
|
||||
nodateext
|
||||
notifempty
|
||||
missingok
|
||||
sharedscripts
|
||||
su abc abc
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user