Skip to content

Instantly share code, notes, and snippets.

@docwhat
Last active February 18, 2021 16:42
Show Gist options
  • Save docwhat/441292d9a95f97b2e5f757d0627c5af1 to your computer and use it in GitHub Desktop.
Save docwhat/441292d9a95f97b2e5f757d0627c5af1 to your computer and use it in GitHub Desktop.
Running docker locally
docker network create jenkins
docker run \
  --detach \
  --rm \
  --net=jenkins \
  --volume=jenkins_home:/var/jenkins_home:rw \
  --volume=/var/run/docker.sock:/var/run/docker.sock:rw \
  --publish=8080:8080 \
  --env=JAVA_OPTS=-DexecutableWar.jetty.sessionIdCookieName=dockerjenkins \
  --name=jenkins \
  jenkins/jenkins:lts
# Needed to login initially.
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword |
  pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment