lestrrat-go / libxml2

Interface to libxml2, with DOM interface
MIT License
230 stars 55 forks source link

docker build found clib undefined #80

Closed asyncins closed 3 years ago

asyncins commented 3 years ago

I'm not sure if it was caused by libxml-2.0, but there was an error prompt when building:

github.com/lestrrat-go/libxml2@v0.0.0-xxx/xpath/xpath.go:179:9: undefined: clib.XMLXPathContextSetContextNode
github.com/lestrrat-go/libxml2@v0.0.0-xxx/xpath/xpath.go:149:2: undefined: clib.XMLXPathFreeCompExpr
github.com/lestrrat-go/libxml2@v0.0.0-xxx/xpath/xpath.go:91:13: undefined: clib.XMLXPathObjectNodeList
too many errors

When i execute pkg-config --list-all (on docker contain), terminal output:

pkg-config --list-all
systemd          systemd - systemd System and Service Manager
icu-io           icu-io - International Components for Unicode: Stream and I/O Library
icu-i18n         icu-i18n - International Components for Unicode: Internationalization library
icu-uc           icu-uc - International Components for Unicode: Common and Data libraries
libxml-2.0       libXML - libXML library version2.
icu-lx           icu-lx - International Components for Unicode: Paragraph Layout library
shared-mime-info shared-mime-info - Freedesktop common MIME database
icu-le           icu-le - International Components for Unicode: Layout library

The libxml-2.0 was installed.

My dockerfile in here:

FROM ubuntu:16.04 as builder
MAINTAINER asyncins
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get install gcc g++ libxml2 libxml2-dev libxslt-dev wget pkg-config -y
RUN wget https://dl.google.com/go/go1.15.6.linux-amd64.tar.gz
RUN tar -C /usr/lib/ -xzf go1.15.6.linux-amd64.tar.gz 
ENV GOROOT=/usr/lib/go
ENV PATH=$PATH:/usr/lib/go/bin
ENV GOPATH=/root/go
ENV PATH=$GOPATH/bin/:$PATH
ENV GO111MODULE=on \
    GOPROXY=https://goproxy.cn,direct

ADD . /go/src/application
WORKDIR /go/src/application
RUN go get all

RUN GOOS=linux GOARCH=386 go build -o MyApp ./main.go

FROM alpine
COPY --from=builder /go/src/application/main /usr/local/bin/MAP

CMD ["MAP"]

can you help me?

lestrrat commented 3 years ago

can you help me?

No, I'm sorry, I can't. I am not your personal debugger, nor do you provide any reproducible code. And it's definitely not this library's problem.

andlimey commented 1 year ago

Hello @asyncins , did you manage to solve this issue?

asyncins commented 1 year ago

收到,谢谢。祝您生活愉快