标签:docke git clone ssh aml dep 9.4 div user compose
记录一下吧 算打一下 tag 最近在整得 swarm + jenkins 实现自动化部署 回滚
#构建jenkins 镜像
#dockerfile:
docker build -t my-jenkins:v1.0
FROM jenkins USER root ARG dockerGid=978 ENV NODE_VERSION 6.9.4 #add jenkins to docker group and install nodejs/npm RUN echo "docker:x:${dockerGid}:jenkins" >> /etc/group && cd /home && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" && xz -d "node-v$NODE_VERSION-linux-x64.tar.xz" && tar xvf "node-v$NODE_VERSION-linux-x64.tar" && ln -s /home/node-v$NODE_VERSION-linux-x64/bin/node /usr/local/bin/node && ln -s /home/node-v$NODE_VERSION-linux-x64/bin/npm /usr/local/bin/npm && rm -rf "node-v$NODE_VERSION-linux-x64.tar" USER jenkins
#docker-compose:
docker-compose -f /jenkins/docker-compose.yml
version: ‘2‘ services: my_jenkins: image: my-jenkins:v1.0 #build: ./dockerfile container_name: jenkins restart: always volumes: - /etc/localtime:/etc/localtime #同步容器time - /jenkins/data:/var/jenkins_home - /bin/docker:/usr/bin/docker - /var/run/docker.sock:/var/run/docker.sock ports: - "9000:8080"
# 虽然同步了 jenkins 时间 时区还是不对 百度 度来一绝技
在jenkins的【系统管理】-【脚本命令行】里运行
System.setProperty(‘org.apache.commons.jelly.tags.fmt.timeZone‘, ‘Asia/Shanghai‘)
#gitlab: docker-compose.yaml 英文版:‘beginor/gitlab-ce:latest’
version: ‘2‘ services: gitlab: image: ‘beginor/gitlab-ce:11.0.1-ce.0‘ #社区版 container_name: gitlab restart: always hostname: ‘gitlab.demo.com‘ environment: GITLAB_OMNIBUS_CONFIG: | external_url ‘http://localhost‘ # Add any other gitlab.rb configuration here, each on its own line ports: - ‘80:80‘ - ‘22:22‘ volumes: - ‘/etc/localtime:/etc/localtime‘ - ‘/gitlab/data/config:/etc/gitlab‘ - ‘/gitlab/data/logs:/var/log/gitlab‘ - ‘/gitlab/data/data:/var/opt/gitlab‘
#简单一下设置git
yum install git -y && ssh-keygen -t rsa
# copy 公钥 > gitlab
git config --global user.name “chen”
git config --global user.email “237356573@qq.com”
git clone git@172.16.0.43:chen/deploy.git
#error 502 错误
测试访问的时候老是提示502,原因在于我的服务器只有1G的内容,不满足gitlab运行的最低配置,gitlab最低的运行内存要求是2GB,配置的虚拟内存来解决问题
sudo dd if=/dev/zero of=/swapfile bs=1024 count=2048k sudo mkswap /swapfile sudo swapon /swapfile sudo vim /etc/fstab
jenkins + gitlab 快速搭建(docker-compose) 时间,时区 同步
标签:docke git clone ssh aml dep 9.4 div user compose
原文地址:https://www.cnblogs.com/python-diy/p/9521220.html