Skip to content

Instantly share code, notes, and snippets.

@retgits
Created April 30, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save retgits/5cc38171444b95c5a69017d1f6e6cc7d to your computer and use it in GitHub Desktop.
Save retgits/5cc38171444b95c5a69017d1f6e6cc7d to your computer and use it in GitHub Desktop.
jenkins script for DockerCon 2019 demo
# Make sure there's no volume or container
docker stop jenkins && docker rm jenkins
docker volume rm jenkins-home
# Download the file from Artifactory
jfrog rt dl generic-prod/jenkins.zip
# Create a volume again
docker run --rm --mount source=jenkins-home,destination=/var/jenkins_home -v $(pwd):/backup alpine:3.9 sh -c "cd / && unzip /backup/jenkins.zip && chmod -R 777 /var/jenkins_home"
# Let's see if it worked
docker run --rm -it --name=jenkins --mount source=jenkins-home,destination=/var/jenkins_home -p 8080:8080 jenkins/jenkins:alpine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment