Tag: 贝壳

在docker中,spring-boot不能启动

在docker中运行我的spring启动应用程序有点问题。 堆栈:maven 3+,春季启动(jpa / rest / jetty) – mysql – 在docker中部署 所以,我已经在我的POM文件 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.M3</version> <relativePath/> <!– lookup parent from repository –> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.8</java.version> </properties> <dependencies> <!– SPRING BOOT DEPENDENCIES –> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <!– add for exlude tomcat –> […]

jenkins工作的壳和bashdocker工人容器的不同的小组

我已经在Docker容器上安装了jenkins master,并在docker容器中使用Swarm插件运行一个slave。 我在docker slave中创build了一个组。 一旦我使用docker exec -it <container> bashinputslave容器并键入groups我创build的组被正确列出。 但是,当我将groups键入工作描述shell并在创build的从属服务器上执行作业时,我的组不会显示。 编辑 :奴隶容器:简单地启动一个jenkins奴隶作为用户jenkins 。 启动时,通过CMD [ "/startup.sh" ]执行以下代码(脚本:startup.sh)。 jenkins-slave.sh提供在https://gist.github.com/sfrehse/02c7d57fad862c71c20f07c59caba240下。 DOCKER_SOCKET=/var/run/docker.sock DOCKER_GROUP=dockergrp JENKINS_USER=jenkins if [ -S ${DOCKER_SOCKET} ]; then DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCKET}) sudo groupadd -for -g ${DOCKER_GID} ${DOCKER_GROUP} sudo usermod -aG ${DOCKER_GROUP} ${JENKINS_USER} fi /usr/local/bin/jenkins-slave.sh 从bash启动后: docker exec -it 8b85afe2b360 groups输出jenkins dockergrp 。 触发包含以下代码的作业: whoami groups […]

Jenkinsfile:在Docker容器中运行sh步骤时拒绝了权限

我运行一个简单的Jenkinsfile有困难 – 例如 pipeline { agent { label 'ssh-slave' } stages { stage('Shell Test') { steps { sh 'echo "Hello World"' } } } } 主人Jenkins的日志文件显示容器已成功启动,但构build作业崩溃,并显示一条消息 sh: 1: /home/jenkins/workspace/pipeline@tmp/durable-34c21b81/script.sh: Permission denied 这里是我们configuration/计算出来的一些额外的东西: 我们正在使用RHEL的虚拟机上运行代理 我们使用Jenkins的Docker Plugin来启动/pipe理单独的Jenkins代理上的容器 我们在Jenkins插件中使用Connect with ssh方法启动Docker容器,并使用jenkinsci / ssh-slave Docker镜像 Jenkins在Docker容器中使用root用户(至less/home/jenkins/…所有文件都是以root身份创build的 当我们在pipe道和docker exec…添加一个sleep步骤到正在运行的容器时,如果我们试图用./script.sh来运行它(即使我们设置了正确的文件模式与之前的chmod +x script.sh ) – 我们也得到sh: 1: permission denied 。 但是我们可以运行脚本,如果我们使用sh script.sh […]