Closed 2020testuser closed 3 years ago
you've probably got something wrong with environment variable expansion on the CGO_CFLAGS. Though you shouldn't really need to be setting those as the default will look in /opt/mqm/inc anyway. Using "-x -a" on the go build will show what's really being executed.
@ibmmqmet - I got it working! Thanks for your help!
@ibmmqmet - I got it working! Thanks for your help!
How did you fix this issue?
Could anyone please help me? I tried with different version of MQ Client package and no luck. Thanks in advance!
I'm getting the below error during build. `# github.com/ibm-messaging/mq-golang/v5/ibmmq /go/pkg/mod/github.com/ibm-messaging/mq-golang/v5@v5.1.3/ibmmq/mqi.go:54:18: fatal error: cmqc.h: No such file or directory
include`
Below is my Dockerfile. `FROM golang:stretch RUN apt-get update && \ apt-get install -y curl && \ curl https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist/9.1.5.0-IBM-MQC-Redist-LinuxX64.tar.gz -o mq.tar.gz && \ mkdir -p /opt/mqm && chmod a+rx /opt/mqm && cd /opt/mqm \ tar -C /opt/mqm -xzf mq.tar.gz RUN export GOPATH=/Users/testuser/Documents/mq1/mq-source RUN export PATH=$PATH:$GOPATH/bin ENV MQ_INSTALLATION_PATH="/opt/mqm" ENV CGO_LDFLAGS_ALLOW="-Wl,-rpath.*" ENV CGO_LDFLAGS="-L$MQ_INSTALLATION_PATH/lib64 -Wl,-rpath,$MQ_INSTALLATION_PATH/lib64" ENV CGO_CFLAGS="-I$MQ_INSTALLATION_PATH/inc" RUN echo $GOPATH RUN mkdir -p $GOPATH/src/github.com/triggermesh/mq WORKDIR $GOPATH/src/github.com/triggermesh/mq COPY . . RUN go get RUN go build -o mq FROM debian:stretch-slim WORKDIR /opt/mqm/ COPY --from=0 /opt/mqm . COPY --from=0 /go/src/github.com/triggermesh/mq/mq .
ENTRYPOINT ["./mq"] `