4
0

docker-proxy.adoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. [#action-container-proxy]
  2. = Using the Docker socket proxy
  3. The OliveTin container comes with the official docker CLI pre-installed, as well as the compose plugin. This is because OliveTin is very often used to start and stop containers.
  4. You can choose to directly bind-mount the docker control socket into OliveTin, or optionally use a docker socket proxy host if you feel you need more security. You can use a docker socket proxy as an additional security measure and as an alternative to mounting the docker socket directly.
  5. Most people will want to add the docker socket proxy into the same compose file that they are running OliveTin from;
  6. [source,yaml]
  7. .docker-compose.yaml
  8. ....
  9. services:
  10. olivetin:
  11. container_name: olivetin
  12. image: jamesread/olivetin
  13. ...
  14. socket-proxy:
  15. image: lscr.io/linuxserver/socket-proxy:latest
  16. container_name: socket-proxy
  17. environment:
  18. - ALLOW_START=1 #optional
  19. - ALLOW_STOP=1 #optional
  20. ...
  21. volumes:
  22. - /var/run/docker.sock:/var/run/docker.sock:ro
  23. ....
  24. You can find all the documentation for all the socket-proxy options here on the link:https://github.com/linuxserver/docker-socket-proxy[LinuxServer.io socket-proxy page].
  25. Assuming your docker socket proxy is running as `socket-proxy` running on port 1028;
  26. [source,yaml]
  27. .OliveTin config.yaml
  28. ----
  29. actions:
  30. - title: Stop container
  31. shell: DOCKER_HOST=socket-proxy:1028 docker stop mycontainer
  32. ----