使用退出代码1退出服务器

时间:2017-10-24 14:17:32

标签: docker-compose go-cd

我正在尝试使用docker compose运行gocd docker镜像。我想用一个新的cruise-config文件替换现有的cruise-config文件。 我试图通过在Dockerfile中复制它来替换现有的cruise-config.xml新文件。我能够构建没有任何错误的docker-compose,但是当我运行docker-compose文件时,go服务器容器启动但几秒后退出,错误代码为1。

文件:Docker-compose.yml

version: '2'
  services:
  go-server:
    build:
      context: go_server
      dockerfile: Dockerfile
    ports:
      - '8153:8153'
      - '8154:8154'
    volumes:
    - ./go_server/server_home/config:/go-working-dir/config

文件:go_server / Dockerfile

   FROM gocd/gocd-server:v17.8.0
    RUN mkdir -p /go-working-dir/config
    RUN chmod 777 -R /go-working-dir/config

    COPY ./server_home/config/cruise-config.xml /go-working-dir/config/cruise-config.xml
    COPY ./server_home/config/cruise-config.xml /go-working-dir/config/cruise-config.xml2

    RUN chown -R go:go /go-working-dir /godata

    EXPOSE 8153 8154

我在这里遗漏了什么吗?容器的日志文件显示没有错误

Logs:
    dailybuild@DockerHost:~$ sudo docker logs 5af1aefa0c9d
    /docker-entrypoint.sh: Creating directories and symlinks to hold GoCD configuration, data, and logs
    $ mkdir -v /godata/artifacts
    $ chown go:go /godata/artifacts
    $ ln -sv /godata/artifacts /go-working-dir/artifacts
    $ chown go:go /go-working-dir/artifacts
    $ mkdir -v /godata/config
    $ chown go:go /godata/config
    $ mkdir -v /godata/db
    $ chown go:go /godata/db
    $ ln -sv /godata/db /go-working-dir/db
    $ chown go:go /go-working-dir/db
    created directory: '/godata/artifacts'
    '/go-working-dir/artifacts' -> '/godata/artifacts'
    created directory: '/godata/config'
    created directory: '/godata/db'
    '/go-working-dir/db' -> '/godata/db'
    created directory: '/godata/logs'
    '/go-working-dir/logs' -> '/godata/logs'
    created directory: '/godata/plugins'
    $ mkdir -v /godata/logs
    $ chown go:go /godata/logs
    $ ln -sv /godata/logs /go-working-dir/logs
    $ chown go:go /go-working-dir/logs
    $ mkdir -v /godata/plugins
    '/go-working-dir/plugins' -> '/godata/plugins'
    created directory: '/godata/addons'
    '/go-working-dir/addons' -> '/godata/addons'
    $ chown go:go /godata/plugins
    $ ln -sv /godata/plugins /go-working-dir/plugins
    $ chown go:go /go-working-dir/plugins
    $ mkdir -v /godata/addons
    $ chown go:go /godata/addons
    $ ln -sv /godata/addons /go-working-dir/addons
    $ chown go:go /go-working-dir/addons

0 个答案:

没有答案