go-tdlib icon indicating copy to clipboard operation
go-tdlib copied to clipboard

Build in docker

Open PullDakar opened this issue 3 years ago • 7 comments

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?

PullDakar avatar Jul 03 '21 10:07 PullDakar

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

iIIusi0n avatar Aug 12 '21 11:08 iIIusi0n

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

Arman92 avatar Aug 12 '21 11:08 Arman92

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

iIIusi0n avatar Aug 15 '21 04:08 iIIusi0n

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 avatar Mar 21 '23 19:03 dimau

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 avatar Mar 22 '23 16:03 dimau

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

dimau avatar Mar 22 '23 17:03 dimau