通过打包程序的构建运行Maven映像时出错

时间:2019-12-25 06:44:14

标签: maven docker continuous-integration packer

通过打包程序运行Maven图像进行构建时,出现以下错误。

docker: Run command: docker run -v /root/.packer.d/tmp904651335:/packer-files -d -i -t --entrypoint=/bin/sh -- maven:3.5.2-jdk-8-alpine
     

==> docker:运行容器时出错:Docker以非零退出状态退出。   ==>泊坞窗:Stderr:泊坞窗:来自守护程序的错误响应:OCI运行时创建失败:container_linux.go:346:启动容器进程引起“ process_linux.go:449:容器初始化引起了\“ process_linux.go:432:运行prestart钩子0导致\\“错误运行挂钩:退出状态2,stdout:,stderr:致命错误:运行时:内存不足\\ n \\ nruntime堆栈:\\ nruntime.throw(0x55f4917c6982,0x16)\\ n \\ t /usr/local/go/src/runtime/panic.go:617 + 0x74 fp = 0x7ffddd5eeda0 sp = 0x7ffddd5eed70 pc = 0x55f48fe87e74 \\ nruntime.sysMap(0xc000000000,0x4000000,0x55​​f493cd53d8)\\ n \\ t / usr / local / go / src / runtime / mem_linux.go:170 + 0xc9 fp = 0x7ffddd5eede0 sp = 0x7ffddd5eeda0 pc = 0x55f48fe723b9 \\ nruntime。(* mheap).sysAlloc(0x55f493cb89c0,0x2000,0x55​​f493 \ b \ t /,本地/ go / src /运行时/malloc.go:633 + 0x1cf fp = 0x7ffddd5eee88 sp = 0x7ffddd5eede0 pc = 0x55f48fe6525f \\ nruntime。(* mheap).grow(0x55f493cb89c0,0x1,0x0)\\ n \ t / usr本地/ go / src /运行时/mheap.go:1222 + 0x44 fp = 0x7ffddd5eeee0 sp = 0x7ffddd5eee88 pc = 0x55f48fe7f7c4 \\ nrun (。 \\ nruntime。(* mheap).alloc_m(0x55f493cb89c0,0x1,0x2a,0x6e43a318)\\ n \\ t / usr / local / go / src / runtime / mheap.go:977 + 0xc6 fp = 0x7ffddd5eef68 sp = 0x7ffddd5e = 0x55f48fe7ed06 \\ nruntime。(* mheap).alloc.func1()\\ n \\ t / usr / local / go / src / runtime / mheap.go:1048 + 0x4e fp = 0x7ffddd5eefa0 sp = 0x7ffddd5eef68 pc = 0x55f48fe7ed06 \ nruntime。(* mheap).alloc(0x55f493cb89c0,0x1,0x55​​f48f01002a,0x7ffddd5ef040)\\ n \\ t / usr / local / go / src / runtime / mheap.go:1047 + 0x8c fp = 0x7ffddddd5eeff0 sp = 0x7 0x55f48fe7efdc \\ nruntime。(* mcentral).grow(0x55f493cb97c0,0x0)\\ n \\ t / usr / local / go / src / runtime / mcentral.go:256 + 0x97 fp = 0x7ffddd5ef038 sp = 0x7ffddd5eeff0 pc = 0x55f \ nruntime。(* mcentral).cacheSpan(0x55f493cb97c0,0x7fd212eef000)\\ n \\ t / usr / local / go / src / runtime / mcentral.go:106 + 0x301 fp = 0x7ffddd5ef098 sp = 0x7ffddd5ef038 pc = 0x55f48fe719 ntime。(* mcache).refill(0x7fd212eef008,0x2a)\\ n \\ t / usr / local / go / src / runtime / mcache.go:135 + 0x88 fp = 0x7ffddd5ef0b8 sp = 0x7ffddd5ef098 pc = 0x55f48fe713d8 \\ nruntime。 (* mcache).nextFree(0x7fd212eef008,0x55​​f493cae12a,0x7fd212eef008,0x7fd212eef000,0x8)\\ n \\ t / usr / local / go / src / runtime / malloc.go:786 + 0x8a fp = 0xxffd5e0f0f0f7bd5e0f0f7 \\ nruntime.mallocgc(0x180,0x55​​f492810d80,0x1,0x55​​f493cd5440)\\ n \\ t / usr / local / go / src / runtime / malloc.go:939 + 0x780 fp = 0x7ffddd5ef190 sp = 0x7ffddd5ef0f0 pc = 0x55f48fe663 .newobject(0x55f492810d80,0x4000)\\ n \\ t / usr / local / go / src / runtime / malloc.go:1068 + 0x3a fp = 0x7ffddd5ef1c0 sp = 0x7ffddd5ef190 pc = 0x55f48fe667da \\ nruntime.malg(0x32100008000,0 \\ n \\ t / usr / local / go / src / runtime / proc.go:3220 + 0x33 fp = 0x7ffddd5ef200 sp = 0x7ffddd5ef1c0 pc = 0x55f48fe91323 \\ nruntime.mpreinit(...)\\ n \\ t / usr / local / go / src / runtime / os_linux.go:311 \\ nruntime.mcommoninit(0x55f493cb3480)\\ n \\ t / usr / local / go / src / runtime / proc.go:618 + 0xc6 fp = 0x7ffddd5ef238 SP = 0x7ffddd5ef200 pc = 0x55f48fe8ac96 \\ nruntime.schedinit()\\ n \\ t / usr / local / go / src / runtime / proc.go:540 + 0x78 fp = 0x7ffddd5ef290 sp = 0x7ffddd5ef238 pc = 0x55f48fe8a928 \ _nruntime。 (0x7ffddd5ef398、0x4、0x7ffddd5ef398、0x0、0x7fd21218e2e1、0x4、0x7ffddd5ef398、0x41107e000、0x55f48feb5bb0、0x0,...)\\ n \\ t / usr / local / go / src / am11。 = 0x7ffddd5ef298 sp = 0x7ffddd5ef290 pc = 0x55f48feb5cde \\ n \\“ \”“:未知。

我正在使用波纹管包装器代码进行构建。

 {
  "builders": [{
    "type": "docker",
    "image": "maven:3.6.0-jdk-11-slim",
    "commit": "true",
    "changes": [
    "WORKDIR /",
    "CMD [\"mvn package\"]",
    "CMD [\"mv target/SpringExample-2.0.3-SNAPSHOT.jar app.jar\"]",
    "ENTRYPOINT [\"docker-entrypoint.sh\"]"
  ]
  }],
  "provisioners": [
    {
    "type": "shell",
    "inline": ["mkdir -p /src"]
    },
    {
    "type": "file",
    "source": "src/",
    "destination": "/src/"
    },
    {
    "type": "file",
    "source": "pom.xml",
    "destination": "/"
    },
    {
    "type": "file",
    "source": "docker-entrypoint.sh",
    "destination": "/"
    }

   ],
  "post-processors": [
    [
      {
        "type": "docker-tag",
        "repository": "satwikmukherjee/####",
        "tag": "maven1.0"
      },
      {
        "type": "docker-push",
        "login": "true",
        "login_username": "#####",
        "login_password": "####"
      }
    ]
  ]
}

1 个答案:

答案 0 :(得分:2)

错误消息显示:

error running hook: exit status 2, stdout: , stderr: fatal error: runtime: out of memory