您正在查看: 2023年4月

jenkins在通过向导进行初始设置期间出现“无法连接到 Jenkins”

跟进问题,实际错误是获取update-center.json更新超时
目前代码写死了
https://github.com/jenkinsci/jenkins/blob/04b46d1c68513e4a105b5acdfb7534c89da94eea/war/src/main/js/api/pluginManager.js#L64

// default 10 seconds for AJAX responses to return before triggering an error condition
var pluginManagerErrorTimeoutMillis = 10 * 1000;

解决方法


动态调试,将pluginManagerErrorTimeoutMillis增加100倍,然后继续

ubuntu jenkins 更改默认端口

找到服务配置

systemctl status jenkins


编辑配置

sudo vi /lib/systemd/system/jenkins.service

修改其中的端口信息

Environment="JENKINS_PORT=8080"

使其生效

sudo systemctl daemon-reload
sudo systemctl restart jenkins

Windows WSL 安装docker

1. Add the necessary repository

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

2. Install the necessary dependencies

sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y

3. Install Docker

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli docker-compose containerd.io -y
sudo apt install gnome-keyring

4. Add your user to the Docker group

sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock
sudo service docker restart

5. Testing the installation

docker version
docker pull hello-world

6.fix "System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down"

sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig

sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target

exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME

snap version

参考文档

https://www.zdnet.com/article/docker-101-how-to-install-docker-on-ubuntu-server-22-04/
https://gist.github.com/alyleite/ca8b10581dbecd722d9dcc35b50d9b2b
https://docs.docker.com/engine/install/ubuntu/