Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make images work #49

Merged
merged 1 commit into from
Dec 7, 2018
Merged

Make images work #49

merged 1 commit into from
Dec 7, 2018

Conversation

gouthamve
Copy link
Member

No clue what the flag is and what fixed it.

With -linkmode=external, this is printed while building the image

# github.com/grafana/loki/cmd/loki
loadinternal: cannot find runtime/cgo

When you try to run the image there is a coredump, see

```➜  loki git:(master) ✗ strace ./cmd/loki/loki
execve("./cmd/loki/loki", ["./cmd/loki/loki"], 0x7ffe400edb30 /* 36 vars */) = 0
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffef5e69200) = -1 EINVAL (Invalid argument)
brk(NULL)                               = 0x3140000
brk(0x31411c0)                          = 0x31411c0
arch_prctl(ARCH_SET_FS, 0x3140880)      = 0
uname({sysname="Linux", nodename="nomad", ...}) = 0
readlink("/proc/self/exe", "/home/goutham/go/src/github.com/"..., 4096) = 58
brk(0x31621c0)                          = 0x31621c0
brk(0x3163000)                          = 0x3163000
arch_prctl(ARCH_SET_FS, 0x12012b0)      = 0
--- SIGTRAP {si_signo=SIGTRAP, si_code=SI_KERNEL} ---
+++ killed by SIGTRAP (core dumped) +++
[1]    14848 trace trap (core dumped)  strace ./cmd/loki/loki```

Signed-off-by: Goutham Veeramachaneni gouthamve@gmail.com

No clue what the flag is and what fixed it.

With `-linkmode=external`, this is printed while building the image
```
loadinternal: cannot find runtime/cgo
```

When you try to run the image there is a coredump, see
```
```➜  loki git:(master) ✗ strace ./cmd/loki/loki
execve("./cmd/loki/loki", ["./cmd/loki/loki"], 0x7ffe400edb30 /* 36 vars */) = 0
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffef5e69200) = -1 EINVAL (Invalid argument)
brk(NULL)                               = 0x3140000
brk(0x31411c0)                          = 0x31411c0
arch_prctl(ARCH_SET_FS, 0x3140880)      = 0
uname({sysname="Linux", nodename="nomad", ...}) = 0
readlink("/proc/self/exe", "/home/goutham/go/src/github.com/"..., 4096) = 58
brk(0x31621c0)                          = 0x31621c0
brk(0x3163000)                          = 0x3163000
arch_prctl(ARCH_SET_FS, 0x12012b0)      = 0
--- SIGTRAP {si_signo=SIGTRAP, si_code=SI_KERNEL} ---
+++ killed by SIGTRAP (core dumped) +++
[1]    14848 trace trap (core dumped)  strace ./cmd/loki/loki```
```

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
@tomwilkie tomwilkie merged commit d5e6c60 into master Dec 7, 2018
@tomwilkie tomwilkie deleted the fix-image branch December 7, 2018 12:37
gouthamve added a commit that referenced this pull request Dec 10, 2018
#49 broke promtail with
standard_init_linux.go:178: exec user process caused "no such file or directory"

From https://medium.com/@diogok/on-golang-static-binaries-cross-compiling-and-plugins-1aed33499671
CGO_ENABLED=0 makes it static, afaics

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
tomwilkie pushed a commit that referenced this pull request Dec 10, 2018
#49 broke promtail with
standard_init_linux.go:178: exec user process caused "no such file or directory"

From https://medium.com/@diogok/on-golang-static-binaries-cross-compiling-and-plugins-1aed33499671
CGO_ENABLED=0 makes it static, afaics

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
periklis added a commit to periklis/loki that referenced this pull request Dec 6, 2021
periklis added a commit to periklis/loki that referenced this pull request Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants