Skip to content

lukaskorl/swarm-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Docker Swarm


lukaskorl/swarm-wrapper

Run containers in Swarm while using Compose features









lukaskorl/swarm-wrapper is a container for running other containers with Docker Compose on a swarm node with access to features like devices which are not available to Swarm Mode.

License

Goals of lukaskorl/swarm-wrapper

  • Temporarily overcome limitations of Swarm Mode
  • Access to hardware devices on Swarm node (i.e. USB devices)
    • Personal use-case is running a ser2net container in a Docker Swarm

Usage

For testing purposes run this image with a Compose file mounted or attached as a secret to /compose.yml:

# Using mount
docker run --rm -it \
	-v /var/run/docker.sock:/var/run/docker.sock \
	-v ./demo/docker-compose.yml:/compose.yml:ro \
	lukaskorl/swarm-wrapper

Advanced networking

This container includes a socat proxy for usage in Swarm mode. It can proxy TCP traffic to another container.

docker run --rm -it \
	-v /var/run/docker.sock:/var/run/docker.sock \
	-v ./demo/docker-compose.yml:/compose.yml:ro \
	-e PROXY_TARGET=host.docker.internal:8088 \
	-p 8080:8080 \
	lukaskorl/swarm-wrapper

In this scenario the whoami container is exposed on port 8088 directly by the compose stack. And on port 8080 through the proxy. Check the output by running curl http://localhost:8080 and curl http://localhost:8088.

Attribution

This container has been develop from an idea of js-home.org originating from a discussion on the Swarmkit repo.



Docker is a registered trademarks of Docker, Inc. This project is not affiliated with Docker, Inc.

About

🐳 Run containers in Swarm while using Compose features

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors