docker-compose安装Jenkins

在 Linux 系统上安装 Compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

添加可执行权限

sudo chmod +x /usr/local/bin/docker-compose

查看是否安装成功

docker-compose --version

Jenkins配置文件docker-compose.yml 

version: '3'
services:
  docker_jenkins:
    restart: always
    image: jenkins/jenkins:lts
    container_name: jenkins
    ports:
      - '8080:8080'
      - '50000:50000'
    volumes:
      - /data/jenkins:/var/jenkins_home

创建映射文件夹并执行权限

sudo mkdir -p /data/jenkins
sudo chown -R 1000:1000 /data/jenkins   # 把当前目录的权限分配给 uid 1000

启动容器

docker-compose up -d
herui

一枚干着DevOps工作的职业命理师

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据