Jenkins - Free Swap Space 0

Run the following command to see if your host has a swap file configured:

  1. free|grep -i Swap
  2. Swap: 0 0 0

If you get “Swap: 0 0 0” like you see above your host has no swap configured.

Configure a swap file on your host

  1. dd if=/dev/zero of=swapfile bs=1M count=1K
  2. mkswap swapfile
  3. sudo chown root:root swapfile
  4. sudo chmod 600 swapfile
  5. sudo swapon swapfile

Verify your swap is configured:

  1. free|grep -i Swap
  2. Swap: 1048572 0 1048572

Good, we have a swap on the host.

Run your Jenkins docker by typing

  1. docker run --privileged -p 8080:8080 --name jenkins -p 50000:50000 jenkins

Notice you must run the docker in privileged mode.

When you run your Jenkins docker in privileged mode the host’s swap will be available inside the docker, so your Jenkins master will have a working swap.

If your host already has a working swap in place, all you will need to do is run the Jenkins docker in privileged mode.

发表评论

表情:
评论列表 (有 0 条评论,57人围观)

还没有评论,来说两句吧...

相关阅读