一千萬個為什麽

搜索

如何在Jenkins上看到Docker slave的stdout



我使用docker作為奴隸,並希望在Jenkins的docker容器中構建。 docker在我的localhost上運行,連接似乎很好。然而,構建過程太快完成,似乎沒有正確運行構建,但我找不到根本原因。

我的問題是:

  1. How to see the stdout of the Docker slave on Jenkins (so I can debug by myself)
  2. Do I need to config other places to use docker-slave correctly?

請檢查我的輸出和設置如下:

My setting on Jenkins: enter image description here

我的 Dockerfile 是:( Dockerfile運行良好 docker build ...

FROM node:8

# Create app directory
RUN mkdir -p /usr/scr/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package*.json /usr/src/app
RUN npm config list
RUN npm config set http-proxy http://proxy:port
RUN npm config set https-proxy http://proxy:port
RUN npm set strict-ssl false
RUN npm install --save-dev cross-env
RUN npm install

# Bundle app source
COPY . /usr/src/app

RUN npm run build
EXPOSE 3000

CMD ["npm", "start"]

Jenkins控制臺登錄的輸出:

Started by user User Name
Start Docker container to host the build
[05/11/18 16:52:34] Launching agent
$ docker -H tcp://localhost:2375 start --interactive --attach 
fb5c7074ffd5b45f0ed2f6e4334a58a6603109915d8bdeff6b701f85ccb90edb
<===[JENKINS REMOTING CAPACITY]===>channel started
Remoting version: 3.17
This is a Unix agent
Evacuated stdout
Agent successfully connected and online
Building remotely on Container for repo#3 in workspace 
/home/jenkins/workspace/repo
 > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url [email protected]:username/repo.git # 
timeout=10
Fetching upstream changes from [email protected]:username/repo.git
 > /usr/bin/git --version # timeout=10
using GIT_SSH to set credentials 
 > /usr/bin/git fetch --tags --progress [email protected]:username/repo.git 
+refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git rev-parse refs/remotes/origin/cicd^{commit} # timeout=10
 > /usr/bin/git rev-parse refs/remotes/origin/origin/cicd^{commit} # 
 timeout=10
Checking out Revision 963706d890c06c130747f905e878535e000438bd 
(refs/remotes/origin/cicd)
 > /usr/bin/git config core.sparsecheckout # timeout=10
 > /usr/bin/git checkout -f 963706d890c06c130747f905e878535e000438bd
Commit message: "add(build): working Dockerfile"
First time build. Skipping changelog.
Finished: SUCCESS

Also I found that my main build container is empty. enter image description here

謝謝你的幫助,我已經在這裏呆了差不多一天了。

轉載註明原文: 如何在Jenkins上看到Docker slave的stdout

一共有 0 個回答: