Skip to content

Instantly share code, notes, and snippets.

@Stephenitis
Last active November 16, 2015 09:11
Show Gist options
  • Save Stephenitis/33355c8792207f03ecc7 to your computer and use it in GitHub Desktop.
Save Stephenitis/33355c8792207f03ecc7 to your computer and use it in GitHub Desktop.
docker run --volume-driver flocker -v myvolume:/data busybox sh -c "echo hello > /data/file.txt"
$ docker volume create -d flocker --name=myvolume
$ docker run -v myvolume:/data busybox sh -c "echo hello > /data/file.txt"
$ docker run -v myvolume:/data busybox sh -c "cat /data/file.txt"
# SWARM
docker -H tcp://$MASTER:2357 volume create -d flocker --name only3
# KUBERNETES
kubectl create -f pod.yml
# pod.yml
apiVersion: v1
kind: Pod
metadata:
name: flocker-web
spec:
containers:
- name: web
image: nginx
ports:
- name: web
containerPort: 80
volumeMounts:
# name must match the volume name below
- name: www-root
mountPath: "/usr/share/nginx/html"
volumes:
- name: www-root
flocker:
datasetName: my-flocker-vol
#marathon
{
"id":"marathon-ha-demo-1",
"apps":[
{
"id": "moby-local",
"container": {
"type": "DOCKER",
"docker": {
"image": "binocarlos/moby-counter:localfile",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 80,
"hostPort": 8500,
"protocol": "tcp"
}],
"parameters": [{
"key": "volume-driver",
"value": "flocker"
},{
"key": "volume",
"value": "marathondemo:/data"
}]
},
"forcePullImage":true
},
"ports":[
8500
],
"instances": 1,
"cpus": 0.3,
"mem": 512
},
{
"id": "moby-redis",
"container": {
"type": "DOCKER",
"docker": {
"image": "binocarlos/moby-counter:latest",
"network": "BRIDGE",
"portMappings": [{
"containerPort": 80,
"hostPort": 8500,
"protocol": "tcp"
}]
},
"forcePullImage":true
},
"ports":[
8500
],
"instances": 1,
"cpus": 0.3,
"mem": 512
},
{
"id": "redis",
"container": {
"type": "DOCKER",
"docker": {
"image": "redis:latest",
"network": "BRIDGE"
},
"forcePullImage":true
},
"ports":[
6379
],
"instances": 1,
"cpus": 0.3,
"mem": 512
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment