English 中文(简体)
Docker standard_init_linux.go:228: execuser process caused: no such file orDirectory
原标题:Docker standard_init_linux.go:228: exec user process caused: no such file or directory

电话 我正试图掌握cker客形象,它正在立即撤出。

CONTAINER ID   IMAGE                      COMMAND                CREATED          STATUS                      PORTS     NAMES
ae327a2bdba3   k8s-for-beginners:v0.0.1   "/k8s-for-beginners"   11 seconds ago   Exited (1) 10 seconds ago             focused_booth

根据集装箱记录

standard_init_linux.go:228: exec user process caused: no such file or directory

我已经编造了所有档案:

FROM alpine:3.10
COPY k8s-for-beginners /
CMD ["/k8s-for-beginners"]

目标:

package main

import (
    "fmt"
    "log"
    "net/http"
)

func main() {
    http.HandleFunc("/", handler)
    log.Fatal(http.ListenAndServe("0.0.0.0:8080", nil))
}

func handler(w http.ResponseWriter, r *http.Request) {
    log.Printf("Ping from %s", r.RemoteAddr)
    fmt.Fprintln(w, "Hello Kubernetes Beginners!")
}

这是库拉文·辛汉普书的首次工作。

我在此过程中使用的指令:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o k8s-for-beginners
sudo docker build -t k8s-for-beginners:v0.0.1 .
sudo docker run -p 8080:8080 -d k8s-for-beginners:v0.0.1

指挥员:

sudo docker run k8s-for-beginners:v0.0.1 ldd /k8s-for-beginners
        /lib64/ld-linux-x86-64.so.2 (0x7f9ab5778000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f9ab5778000)
Error loading shared library libgo.so.16: No such file or directory (needed by /k8s-for-beginners)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /k8s-for-beginners)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /k8s-for-beginners)
Error relocating /k8s-for-beginners: crypto..z2frsa..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fx509..import: symbol not found
Error relocating /k8s-for-beginners: log..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fmd5..import: symbol not found
Error relocating /k8s-for-beginners: crypto..import: symbol not found
Error relocating /k8s-for-beginners: bytes..import: symbol not found
Error relocating /k8s-for-beginners: fmt.Fprintln: symbol not found
Error relocating /k8s-for-beginners: crypto..z2felliptic..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fx509..z2fpkix..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2frand..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fchacha20poly1305..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fcurve25519..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fidna..import: symbol not found
Error relocating /k8s-for-beginners: internal..z2foserror..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fecdsa..import: symbol not found
Error relocating /k8s-for-beginners: net..z2fhttp.HandleFunc: symbol not found
Error relocating /k8s-for-beginners: io..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fhttp2..z2fhpack..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fcipher..import: symbol not found
Error relocating /k8s-for-beginners: log.Fatal: symbol not found
Error relocating /k8s-for-beginners: math..z2fbig..import: symbol not found
Error relocating /k8s-for-beginners: runtime..import: symbol not found
Error relocating /k8s-for-beginners: net..z2fhttp..import: symbol not found
Error relocating /k8s-for-beginners: hash..z2fcrc32..import: symbol not found
Error relocating /k8s-for-beginners: net..z2fhttp.ListenAndServe: symbol not found
Error relocating /k8s-for-beginners: context..import: symbol not found
Error relocating /k8s-for-beginners: fmt..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2ftls..import: symbol not found
Error relocating /k8s-for-beginners: errors..import: symbol not found
Error relocating /k8s-for-beginners: internal..z2ftestlog..import: symbol not found
Error relocating /k8s-for-beginners: runtime.setIsCgo: symbol not found
Error relocating /k8s-for-beginners: runtime_m: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fhex..import: symbol not found
Error relocating /k8s-for-beginners: mime..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2funicode..z2fbidi..import: symbol not found
Error relocating /k8s-for-beginners: internal..z2freflectlite..import: symbol not found
Error relocating /k8s-for-beginners: compress..z2fgzip..import: symbol not found
Error relocating /k8s-for-beginners: sync..import: symbol not found
Error relocating /k8s-for-beginners: compress..z2fflate..import: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fbinary..import: symbol not found
Error relocating /k8s-for-beginners: math..z2frand..import: symbol not found
Error relocating /k8s-for-beginners: runtime_cpuinit: symbol not found
Error relocating /k8s-for-beginners: internal..z2fpoll..import: symbol not found
Error relocating /k8s-for-beginners: mime..z2fmultipart..import: symbol not found
Error relocating /k8s-for-beginners: runtime.check: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fcryptobyte..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fsha512..import: symbol not found
Error relocating /k8s-for-beginners: runtime.registerTypeDescriptors: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fchacha20..import: symbol not found
Error relocating /k8s-for-beginners: runtime.setmodinfo: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2ftransform..import: symbol not found
Error relocating /k8s-for-beginners: time..import: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fbase64..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fsha256..import: symbol not found
Error relocating /k8s-for-beginners: __go_go: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fhttp..z2fhttpguts..import: symbol not found
Error relocating /k8s-for-beginners: path..z2ffilepath..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2fsecure..z2fbidirule..import: symbol not found
Error relocating /k8s-for-beginners: os..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fhttp..z2fhttpproxy..import: symbol not found
Error relocating /k8s-for-beginners: net..z2ftextproto..import: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fasn1..import: symbol not found
Error relocating /k8s-for-beginners: runtime.requireitab: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fdns..z2fdnsmessage..import: symbol not found
Error relocating /k8s-for-beginners: path..import: symbol not found
Error relocating /k8s-for-beginners: io..z2fioutil..import: symbol not found
Error relocating /k8s-for-beginners: sort..import: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2funicode..z2fnorm..import: symbol not found
Error relocating /k8s-for-beginners: internal..z2fcpu..import: symbol not found
Error relocating /k8s-for-beginners: runtime.ginit: symbol not found
Error relocating /k8s-for-beginners: runtime.osinit: symbol not found
Error relocating /k8s-for-beginners: runtime.schedinit: symbol not found
Error relocating /k8s-for-beginners: bufio..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2finternal..z2frandutil..import: symbol not found
Error relocating /k8s-for-beginners: runtime_mstart: symbol not found
Error relocating /k8s-for-beginners: net..import: symbol not found
Error relocating /k8s-for-beginners: strconv..import: symbol not found
Error relocating /k8s-for-beginners: runtime.args: symbol not found
Error relocating /k8s-for-beginners: runtime..z2finternal..z2fsys..import: symbol not found
Error relocating /k8s-for-beginners: runtime.newobject: symbol not found
Error relocating /k8s-for-beginners: syscall..import: symbol not found
Error relocating /k8s-for-beginners: unicode..import: symbol not found
Error relocating /k8s-for-beginners: net..z2fhttp..z2finternal..import: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fpem..import: symbol not found
Error relocating /k8s-for-beginners: _Unwind_Resume: symbol not found
Error relocating /k8s-for-beginners: reflect..import: symbol not found
Error relocating /k8s-for-beginners: mime..z2fquotedprintable..import: symbol not found
Error relocating /k8s-for-beginners: log.Printf: symbol not found
Error relocating /k8s-for-beginners: runtime.typedmemmove: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fdsa..import: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fsha1..import: symbol not found
Error relocating /k8s-for-beginners: bufio..types: symbol not found
Error relocating /k8s-for-beginners: bytes..types: symbol not found
Error relocating /k8s-for-beginners: compress..z2fflate..types: symbol not found
Error relocating /k8s-for-beginners: compress..z2fgzip..types: symbol not found
Error relocating /k8s-for-beginners: context..types: symbol not found
Error relocating /k8s-for-beginners: crypto..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fcipher..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fdsa..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fecdsa..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2felliptic..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2finternal..z2frandutil..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fmd5..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2frand..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2frsa..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fsha1..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fsha256..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fsha512..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2ftls..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fx509..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fx509..z2fpkix..types: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fasn1..types: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fbase64..types: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fbinary..types: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fhex..types: symbol not found
Error relocating /k8s-for-beginners: encoding..z2fpem..types: symbol not found
Error relocating /k8s-for-beginners: errors..types: symbol not found
Error relocating /k8s-for-beginners: fmt..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fchacha20..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fchacha20poly1305..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fcryptobyte..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fcurve25519..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fdns..z2fdnsmessage..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fhttp..z2fhttpguts..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fhttp..z2fhttpproxy..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fhttp2..z2fhpack..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fnet..z2fidna..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2fsecure..z2fbidirule..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2ftransform..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2funicode..z2fbidi..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2ftext..z2funicode..z2fnorm..types: symbol not found
Error relocating /k8s-for-beginners: hash..z2fcrc32..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2fcpu..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2foserror..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2fpoll..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2freflectlite..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2ftestlog..types: symbol not found
Error relocating /k8s-for-beginners: io..types: symbol not found
Error relocating /k8s-for-beginners: io..z2fioutil..types: symbol not found
Error relocating /k8s-for-beginners: log..types: symbol not found
Error relocating /k8s-for-beginners: math..z2fbig..types: symbol not found
Error relocating /k8s-for-beginners: math..z2frand..types: symbol not found
Error relocating /k8s-for-beginners: mime..types: symbol not found
Error relocating /k8s-for-beginners: mime..z2fmultipart..types: symbol not found
Error relocating /k8s-for-beginners: mime..z2fquotedprintable..types: symbol not found
Error relocating /k8s-for-beginners: net..types: symbol not found
Error relocating /k8s-for-beginners: net..z2fhttp..types: symbol not found
Error relocating /k8s-for-beginners: net..z2fhttp..z2finternal..types: symbol not found
Error relocating /k8s-for-beginners: net..z2ftextproto..types: symbol not found
Error relocating /k8s-for-beginners: os..types: symbol not found
Error relocating /k8s-for-beginners: path..types: symbol not found
Error relocating /k8s-for-beginners: path..z2ffilepath..types: symbol not found
Error relocating /k8s-for-beginners: reflect..types: symbol not found
Error relocating /k8s-for-beginners: runtime..types: symbol not found
Error relocating /k8s-for-beginners: runtime..z2finternal..z2fsys..types: symbol not found
Error relocating /k8s-for-beginners: sort..types: symbol not found
Error relocating /k8s-for-beginners: strconv..types: symbol not found
Error relocating /k8s-for-beginners: sync..types: symbol not found
Error relocating /k8s-for-beginners: syscall..types: symbol not found
Error relocating /k8s-for-beginners: time..types: symbol not found
Error relocating /k8s-for-beginners: unicode..types: symbol not found
Error relocating /k8s-for-beginners: container..z2flist..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2faes..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fdes..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fed25519..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fed25519..z2finternal..z2fedwards25519..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fhmac..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2finternal..z2fsubtle..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2frc4..types: symbol not found
Error relocating /k8s-for-beginners: crypto..z2fsubtle..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fcryptobyte..z2fasn1..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fhkdf..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2finternal..z2fsubtle..types: symbol not found
Error relocating /k8s-for-beginners: golang.x2eorg..z2fx..z2fcrypto..z2fpoly1305..types: symbol not found
Error relocating /k8s-for-beginners: hash..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2fbytealg..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2ffmtsort..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2fnettrace..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2frace..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2fsingleflight..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2fsyscall..z2fexecenv..types: symbol not found
Error relocating /k8s-for-beginners: internal..z2fsyscall..z2funix..types: symbol not found
Error relocating /k8s-for-beginners: math..types: symbol not found
Error relocating /k8s-for-beginners: math..z2fbits..types: symbol not found
Error relocating /k8s-for-beginners: net..z2fhttp..z2fhttptrace..types: symbol not found
Error relocating /k8s-for-beginners: net..z2furl..types: symbol not found
Error relocating /k8s-for-beginners: runtime..z2finternal..z2fatomic..types: symbol not found
Error relocating /k8s-for-beginners: runtime..z2finternal..z2fmath..types: symbol not found
Error relocating /k8s-for-beginners: strings..types: symbol not found
Error relocating /k8s-for-beginners: sync..z2fatomic..types: symbol not found
Error relocating /k8s-for-beginners: unicode..z2futf16..types: symbol not found
Error relocating /k8s-for-beginners: unicode..z2futf8..types: symbol not found
Error relocating /k8s-for-beginners: runtime.strequal..f: symbol not found
Error relocating /k8s-for-beginners: runtime.memequal64..f: symbol not found
Error relocating /k8s-for-beginners: type...1reflect.rtype: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Align: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Align: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.AssignableTo: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.AssignableTo: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Bits: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Bits: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.ChanDir: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.ChanDir: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Comparable: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Comparable: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.ConvertibleTo: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.ConvertibleTo: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Elem: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Elem: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Field: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Field: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldAlign: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldAlign: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldByIndex: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldByIndex: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldByName: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldByName: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldByNameFunc: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.FieldByNameFunc: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Implements: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Implements: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.In: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.In: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.IsVariadic: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.IsVariadic: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Key: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Key: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Kind: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Kind: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Len: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Len: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Method: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Method: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.MethodByName: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.MethodByName: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Name: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Name: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumField: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumField: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumIn: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumIn: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumMethod: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumMethod: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumOut: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.NumOut: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Out: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Out: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.PkgPath: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.PkgPath: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Size: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.Size: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.String: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.String: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.common: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.common: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.rawString: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.rawString: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.uncommon..stub: symbol not found
Error relocating /k8s-for-beginners: reflect.rtype.uncommon..stub: symbol not found
Error relocating /k8s-for-beginners: reflect..reflect.rtype..d: symbol not found
Error relocating /k8s-for-beginners: type...1net.IPAddr: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.Network: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.Network: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.String: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.String: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.family: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.family: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.isWildcard: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.isWildcard: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.sockaddr: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.sockaddr: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.toLocal: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr.toLocal: symbol not found
Error relocating /k8s-for-beginners: net.IPAddr..d: symbol not found
Error relocating /k8s-for-beginners: runtime.main: symbol not found
Error relocating /k8s-for-beginners: runtime_iscgo: symbol not found
Error relocating /k8s-for-beginners: runtime_isstarted: symbol not found
Error relocating /k8s-for-beginners: runtime_isarchive: symbol not found
Error relocating /k8s-for-beginners: __gcc_personality_v0: symbol not found
Error relocating /k8s-for-beginners: io.Writer..d: symbol not found
Error relocating /k8s-for-beginners: runtime.writeBarrier: symbol not found

最佳回答

Since you re already using Docker, I d suggest using a multi-stage build. Using a standard docker image like golang one can build an executable asset which is guaranteed to work with other docker linux images:

FROM golang:1.17 as builder

# first (build) stage

WORKDIR /app
COPY . .
RUN go mod download
RUN CGO_ENABLED=0 go build -o k8s-for-beginners

# final (target) stage

FROM alpine:3.10
COPY --from=builder /app/k8s-for-beginners /
CMD ["/k8s-for-beginners"]

注:自您使用<代码>CGO_ENABLED=0以来 您可以用一个小得多的<代码>scratch集装箱操作。 为此,将<代码>FROM alpine:3.10改为FROM scratch


P.S. 确保与相同的名录上有<代码>go.mod。 缩略语

go mod init k8sapp     # creates a `go.mod`

或可创建<代码>go.mod 人工:

module k8sapp

go 1.17
问题回答

在我的特定情况下,这一准确的错误是用不正确的Windows/DOS项目结束语制作的“Bash”条目文字造成的。

在Docker案卷中添加:

RUN dos2unix /entrypoint.sh

如未安装<代码>ds2unix,则序号如下:

# For Alpine Linux:
RUN apk add dos2unix
# For Ubuntu:
RUN apt-get install dos2unix

We came across this error earlier today. My colleague built an image on his Mac and when we deployed to our kubernetes cluster we got this error. I built on a PC and the image worked. When we reviewed the image registry we observed that building on the Mac, the architecture was arm64 which was not compatible with our cluster. Building on my PC the architecture was amd64

页: 1 如何利用你的形象——插图

docker build --platform linux/amd64

From Microsoft: The error message "standard_init_linux.go:228: exec user process caused: exec format error" usually indicates that the binary format of the container image is not compatible with the host machine. This could happen if you are trying to run an ARM64-based image on an AMD64-based machine or vice versa.

when build image, I use arm64v8/busybox:latest, then it s ok





相关问题
Silverlight: Add same UserControl to more than one Canvas

I have a bunch of UserControls ( MyUserControl ) that I want to have a user manually add to one or more Canvases. One instance of a UserControl cannot be a child element of more than one container (...

c++ templated container scanner

here s today s dilemma: suppose I ve class A{ public: virtual void doit() = 0; } then various subclasses of A, all implementing their good doit method. Now suppose I want to write a function ...

Multi-Dimensional Container in Java

I searched around on Google, but I was unable to find any libraries for a multi-dimensional container in Java (preferably one that supports generics as well). I could easily write one (in fact, I ...

c# stack queue combination

is there in C# some already defined generic container which can be used as Stack and as Queue at the same time? I just want to be able to append elements either to the end, or to the front of the ...

Custom container requirement to work with Qt s foreach

What is the bare minimum amount of code to create a custom container that would work with Qt foreach macro? I have this so far template< class T > class MyList { public: class iterator { ...

Having many stacks with different types

I m making a C program that needs to use two stacks. One needs to hold chars, the other needs to hold doubles. I have two structs, node and stack: struct node { double value; struct node *...

热门标签