golang docker build 制作完进项后运行报错

出现该问题的原因是编译的环境和运行的环境不同,可能有动态库的依赖

1.默认go使用静态链接,在docker的golang环境中默认是使用动态编译。

2.如果想使用docker编译+alpine部署,可以通过禁用cgoCGO_ENABLED=0来解决。

3.如果要使用cgo可以通过go build --ldflags "-extldflags -static" 来让gcc使用静态编译。

参考: https://yryz.net/post/golang-docker-alpine-start-panic.html

standard_init_linux.go:178: exec user process caused "no such file or directory"的更多相关文章

  1. standard_init_linux.go:207: exec user process caused "no such file or directory"

    运行docker容器异常中止,使用docker logs CONTAINER_ID查看异常信息如下:standard_init_linux.go:207: exec user process caus ...

  2. windows上启动docker容器报错:standard_init_linux.go:211: exec user process caused “no such file or directory” - Docker

    解决方案: standard_init_linux.go:190: exec user process caused "no such file or directory" - D ...

  3. 自定义容器启动脚本报错:exec user process caused "no such file or directory"

    创建容器起不来,一直是restarting状态,查看容器的报错日志如下: standard_init_linux.go:178: exec user process caused "no s ...

  4. 容器启动脚本报错:exec user process caused "no such file or directory"

    1.现象 standard_init_linux.go:: exec user process caused "no such file or directory" 2.原因 原因 ...

  5. docker-compose exec时 出现"fork/exec /proc/self/exe: no such file or directory" 报错

    问题:跟往常一样执行docker-compos exec redis sh时出现如下错误,而容器是运行状态中. # docker-compose exec redis sh rpc error: co ...

  6. docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"ping\": executable file not found in $PATH": unknown.

    docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting cont ...

  7. /usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:245: running exec setns .....

    docker创建容器时报错如下: containerd: start container" error="oci runtime error: container_linux.go ...

  8. OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "ip": executable file not found in $PATH: unknown (Docker容器没有ip addr命令:exec ip addr 报错)

    一.报错 1.报错信息1: OCI runtime exec failed: exec failed: container_linux.go:380: starting container proce ...

  9. OCI runtime create failed: container_linux.go:349: starting container process caused "exec: "bash": executable file not found in $PATH": unknown

    docker save docker save centos:self -o centos.tar 导出镜像到文件 用于持久化镜像,导出的tar包需要用 docker load -i imagedat ...

随机推荐

  1. Java枚举的用法和原理深入

    转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10843644.html 一:枚举的用法 1.定义和组织常量 在JDK1.5之前,我们定义常量都是:publi ...

  2. ARM64编译工具链下载

    下面是自制的用于编译ARMv8指令的交叉编译工具链: 1.运行在PC上,支持SVE指令,不支持SVE ACLE,版本GCC9.2 https://pan.baidu.com/s/1_NnwajWCel ...

  3. Linux IO 概念(2)

    在上一篇IO底层的概念中杂合了很多模糊的概念,受知识水平的限制,只是从网上抄了很多过来.从linux一切皆文件的设计哲学,介绍了文件描述符,从进程的运行内存分配,进程的切换,介绍了进程的阻塞,以及引出 ...

  4. Ubuntu 开发环境搭建教程

    Ubuntu 开发环境搭建教程 本文原始地址:https://sitoi.cn/posts/18425.html 更新 sudo apt upgrade sudo apt update 生成本机密钥 ...

  5. construct2 入门

    construct2特点 construct2是一款跨平台二维游戏开发引擎,不需要编码,通过定义各个部件和事件完成html5的游戏开发.该引擎可以将开发的封装成多种形式,如phonegap.cocoo ...

  6. 简单理解EM算法Expectation Maximization

    1.EM算法概念 EM 算法,全称 Expectation Maximization Algorithm.期望最大算法是一种迭代算法,用于含有隐变量(Hidden Variable)的概率参数模型的最 ...

  7. 数据结构 - 链栈的实现 C++

    链栈封装 C++ 使用C++对链栈进行了简单的封装,实现了栈的基本操作 封装方法: pop(),top(),size(),empty(),push() 代码已经过测试 #pragma once #in ...

  8. git blame (10)

    git blame system_server.c 每一行提交的sha ,作者,提交的日期及提交的信息

  9. selenium--获取HTML源码断言和URL地址

    获取HTML源码 from selenium import webdriver import unittest class Test_source(unittest.TestCase): def Te ...

  10. Linux下进程间通信方式——pipe(管道)

    每个进程各自有不同的用户地址空间,任何一个进程的全局变量在另一个进程中都看不到,所以进程之间要交换数据必须通过内核,在内核中开辟一块缓冲区,进程A把数据从用户空间拷到内核缓冲区,进程B再从内核缓冲区把 ...