-
Notifications
You must be signed in to change notification settings - Fork 209
/
docker_run_examples.txt
28 lines (24 loc) · 2.19 KB
/
docker_run_examples.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# run docker-dind to be able to execute docker commands in other containers
# it uses docker UNIX socket at /var/run/docker.sock to communicate with docker deamon
# docker-dind container PATH directory is mounted into docker-dind volume
# more documentation https://hub.docker.com/_/docker/
docker run --privileged --name docker-dind --rm -v /var/run/docker.sock:/var/run/docker.sock -v docker-dind:/usr/local/bin -d docker:dind
# run jenkins container with jobs importing
# to be able to tun sitespeed.io tests you need to run docker-dind container before running jenkins container
# more about jenkins https://jenkins.io/doc/
docker run --name jenkins -v <local path to tests>:/var/lib/jmeter-scenarios/ -v jenkins-workspace/:/var/lib/jenkins-workspace/ -v /var/lib/sitespeed.io/:/var/lib/sitespeed.io/ -v docker-dind:/usr/local/bin/dind/ -v /var/run/docker.sock:/var/run/docker.sock --rm -p 8181:8080 jenkins
# run portainer to monitor your docker environment on web
# more https://github.com/portainer/portainer
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer --name portainer
# run sitespeed.io test
# params :
# --browsertime.browser - which browser to use (chrome, firefox)
# --browsertime.iterations - number of test iterations
# URL - urls to test. To test multiple sites use space as a delimiter. Example https://google.com/ https://dou.ua/
# more documentation https://www.sitespeed.io/documentation/sitespeed.io/
docker run --shm-size=1g --rm -v "/var/lib/sitespeed.io":/sitespeed.io sitespeedio/sitespeed.io --browsertime.browser chrome --browsertime.iterations 1 https://google.com/
_______
graphite_network=$(docker inspect --format='{{.HostConfig.NetworkMode}}' graphite)
docker run --network=$graphite_network --privileged=true --shm-size=1g --rm -v "/var/lib/sitespeed.io/":/sitespeed.io sitespeedio/sitespeed.io --graphite.host graphite --graphite.port 2003 --graphite.httpPort 80 --browsertime.browser $browser --browsertime.iterations $run_number https://$URL/
# run jmeter
docker run --rm --name jmeter --volumes-from=jenkins -e SCENARIO=$WORKSPACE/$SCENARIO -e WORKSPACE=$WORKSPACE -e USERS=$USERS -e PAMPUP=$RAMPUP -e HOLDLOAD=$HOLDLOAD -e SHUTDOWN=$SHUTDOWN jmeter