mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 23:39:41 +02:00
Added swarm on docker-machine example.
This commit is contained in:
parent
a198382c06
commit
49d4c5800f
4 changed files with 33 additions and 0 deletions
3
examples/swarm/Dockerfile
Normal file
3
examples/swarm/Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
FROM debian
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y socat
|
11
examples/swarm/README.md
Normal file
11
examples/swarm/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# DockerUI with Swarm
|
||||||
|
|
||||||
|
This example works with swarm clusters created with docker-machine.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Make sure your client is pointed directly to the Docker daemon on the swarm-master's node (not through swarm).
|
||||||
|
|
||||||
|
```
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
11
examples/swarm/docker-compose.yml
Normal file
11
examples/swarm/docker-compose.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
dockerui:
|
||||||
|
image: dockerui/dockerui
|
||||||
|
command: -e http://127.0.0.1:2375
|
||||||
|
net: "host"
|
||||||
|
|
||||||
|
socat:
|
||||||
|
build: .
|
||||||
|
net: "host"
|
||||||
|
command: socat -d -d TCP-L:2375,fork,bind=localhost ssl:127.0.0.1:3376,cert=/var/lib/boot2docker/server.pem,cafile=/var/lib/boot2docker/ca.pem,key=/var/lib/boot2docker/server-key.pem
|
||||||
|
volumes:
|
||||||
|
- /var/lib/boot2docker:/var/lib/boot2docker
|
|
@ -37,6 +37,7 @@ module.exports = function (grunt) {
|
||||||
]);
|
]);
|
||||||
grunt.registerTask('test-watch', ['karma:watch']);
|
grunt.registerTask('test-watch', ['karma:watch']);
|
||||||
grunt.registerTask('run', ['if:binaryNotExist', 'build', 'shell:buildImage', 'shell:run']);
|
grunt.registerTask('run', ['if:binaryNotExist', 'build', 'shell:buildImage', 'shell:run']);
|
||||||
|
grunt.registerTask('runSwarm', ['if:binaryNotExist', 'build', 'shell:buildImage', 'shell:runSwarm']);
|
||||||
grunt.registerTask('run-dev', ['if:binaryNotExist', 'shell:buildImage', 'shell:run', 'watch:build']);
|
grunt.registerTask('run-dev', ['if:binaryNotExist', 'shell:buildImage', 'shell:run', 'watch:build']);
|
||||||
|
|
||||||
// Print a timestamp (useful for when watching)
|
// Print a timestamp (useful for when watching)
|
||||||
|
@ -259,6 +260,13 @@ module.exports = function (grunt) {
|
||||||
'docker run --privileged -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --name dockerui dockerui'
|
'docker run --privileged -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --name dockerui dockerui'
|
||||||
].join(';')
|
].join(';')
|
||||||
},
|
},
|
||||||
|
runSwarm: {
|
||||||
|
command: [
|
||||||
|
'docker stop dockerui',
|
||||||
|
'docker rm dockerui',
|
||||||
|
'docker run --net=host -d --name dockerui dockerui -e http://127.0.0.1:2374'
|
||||||
|
].join(';')
|
||||||
|
},
|
||||||
cleanImages: {
|
cleanImages: {
|
||||||
command: 'docker rmi $(docker images -q -f dangling=true)'
|
command: 'docker rmi $(docker images -q -f dangling=true)'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue