Skip to content

Instantly share code, notes, and snippets.

@kmurudi
Last active June 29, 2017 18:45
Show Gist options
  • Save kmurudi/a87d7dbaab42f36eba2be5bc6856664e to your computer and use it in GitHub Desktop.
Save kmurudi/a87d7dbaab42f36eba2be5bc6856664e to your computer and use it in GitHub Desktop.
stored at - /etc/systemd/system/multi-user.target.wants/
WORKSHOPS_URLS="https://raw.githubusercontent.com/kmurudi/openshift-cns-testdrive/master/labguide/_cns_testdrive.yaml"
CONTENT_URL_PREFIX="https://raw.githubusercontent.com/kmurudi/openshift-cns-testdrive/master/labguide/"
[Unit]
Description=Lab guide container
After=docker.service
Requires=docker.service
[Service]
EnvironmentFile=/etc/sysconfig/workshopper
#ExecStartPre=-/usr/bin/docker create --name %n -p 80:8080 --env-file /etc/sysconfig/workshopper docker.io/osevg/workshopper:0.1
ExecStart=/opt/bin/systemd-docker --env run --rm --name %n -p 80:8080 docker.io/osevg/workshopper:0.1
Restart=always
RestartSec=10s
Type=notify
NotifyAccess=all
TimeoutStartSec=120
TimeoutStopSec=15
[Install]
WantedBy=multi-user.target
1) sudo systemctl stop docker-lab.service
2) docker ps -a
3) Remove container (all one byone if many) - docker -f rm dokcer-lab.service (or whatever names are present)
4) again check - docker ps -a ---saw empty now
5) systemctl daemon-reload
6) systemctl start docker-lab.service
7) check status - active - will see logs down to connect to urls ---- command - $ systemctl status docker-lab.service
8) see docker port mapping -- docker ps
9) connected to browser - localhost:80
10) stopped service - systemctl stop docker-lab
11) browser shows no content
12) started service again - systemctl start docker-lab
13) browser shows content again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment