Get the latest LTS (long term support) image:
|
|
Create a volume to store persistent data:
|
|
Create and run a container:
|
|
Arguments:
-d: detached mode
-v: attach volume (volname:mountpath:optionaloptions)
-p: assign port target (e.g. host 8081 mapped from container 8080)
--name: name of the container
Using the more modern --mount
:
--mount type=volume,source=jenkins_vol,target=/var/jenkins_home
Example:
|
|
Output is the full ID of the launched container:
231b93f9979451a22c45cda22438f53b5309ac1608534364f225b5d138ba8050
See the process running:
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
231b93f99794 jenkins/jenkins:lts "/sbin/tini -- /usr/…" About a minute ago Up About a minute 50000/tcp, 0.0.0.0:8081->8080/tcp jenkins-local
Now go to http://localhost:8081
Get the initial security password:
|
|
Output:
32af70bf57de4...699d7f3e2d29c4e
User ID = admin, p/w = whatever
Restart an existing container:
|
|
Logs can be tailed/followed:
|
|
Full details about additional set-up and configuration:
Topics include:
jenkins_home
directory.Log on to the container:
|
|
Or, to log on as root:
|
|