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

Build in docker #88

Open
PullDakar opened this issue Jul 3, 2021 · 7 comments
Open

Build in docker #88

PullDakar opened this issue Jul 3, 2021 · 7 comments

Comments

@PullDakar
Copy link

PullDakar commented Jul 3, 2021

Hello! I'm trying to build docker image from README.md.
When i execute the command "docker build -fDockerfile -ttelegram-client ." on step:
Step 12/15 : RUN go build --ldflags "-extldflags '-static -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -ldl -lm -lssl -lcrypto -lstdc++ -lz'" -o /tmp/demo-exe main.go

i get error:
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lc++
collect2: error: ld returned 1 exit status
The command '/bin/sh -c go build --ldflags "-extldflags '-static -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -ldl -lm -lssl -lcrypto -lstdc++ -lz'" -o /tmp/demo-exe main.go' returned a non-zero code: 2

How can I assemble the image correctly?

@iIIusi0n
Copy link

I have the same error. I did the test without -lstd++ flag but still experience the same thing... Is there any update?

@Arman92
Copy link
Owner

Arman92 commented Aug 12, 2021

Please use v2 branch while I investigate this issue. I believe this issue would be fixed in v2.

@iIIusi0n
Copy link

There is another issue in v2 branch but i fixed this error with wsl. Maybe there is problem in pre build docker container.

@dimau
Copy link

dimau commented Mar 21, 2023

Please use v2 branch while I investigate this issue. I believe this issue would be fixed in v2.

Sorry, I tried to use v2 branch (like this "go get github.com/Arman92/go-tdlib@v2" using Go 1.20), but got an error, can you please advise, how to do it correctly?
go: github.com/Arman92/go-tdlib@v2: no matching versions for query "v2"

@dimau
Copy link

dimau commented Mar 22, 2023

Please use v2 branch while I investigate this issue. I believe this issue would be fixed in v2.

Sorry, I tried to use v2 branch (like this "go get github.com/Arman92/go-tdlib@v2" using Go 1.20), but got an error, can you please advise, how to do it correctly? go: github.com/Arman92/go-tdlib@v2: no matching versions for query "v2"

Answer: go get github.com/Arman92/go-tdlib/v2@3b65411 works fine

@dimau
Copy link

dimau commented Mar 22, 2023

The same problem with v2 branch

=> ERROR [golang 12/12] RUN go build --ldflags "-extldflags '-static -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -ldl  6.5s
------
 > [golang 12/12] RUN go build --ldflags "-extldflags '-static -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -ldl -lm -lssl -lcrypto -lstdc++ -lz'" -o /tmp/demo-exe main.go:
#20 6.450 # github.com/Arman92/go-tdlib/v2/client
#20 6.450 /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lc++
#20 6.450 collect2: error: ld returned 1 exit status

@Pichas
Copy link

Pichas commented Apr 27, 2024

RUN sed -i 's|-lc++|-lstdc++|p' /go/pkg/mod/github.com/\!arman92/go-tdlib@v1.0.0/tdlib.go

RUN go build --ldflags "-extldflags '-static -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -ldl -lm -lssl -lcrypto -lstdc++ -lz'" -o /tmp/binary main.go

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

No branches or pull requests

5 participants