I built and ran an IBM MQ container image natively on M1 Apple Silicon by running
git clone https://github.com/ibm-messaging/mq-container.git
cd mq-container
make build-devserver
Then I wrote a simple Dockerfile for my Golang application that attempts to talk to the queue manager using mq-golang-jms20
FROM ibm-mqadvanced-server-dev:9.4.0.0-arm64 AS mq
FROM arm64v8/golang:1.22-bullseye AS builder
# set working dir
WORKDIR /app
# copy files and download deps
COPY go.* ./
RUN go mod download
# copy entire app code to working dir
COPY . ./
# update builder container to install MQ Golang libs (it depends on the native C client)
RUN mkdir -p /opt/mqm && chmod a+rx /opt/mqm
COPY --chown=0:0 --from=mq /opt/mqm /opt/mqm
RUN GOOS=darwin GOARCH=arm64 go build -v -o server ./main.go
I built my image using docker-compose with this docker-compose file
services:
mq:
image: ibm-mqadvanced-server-dev:9.4.0.0-arm64
container_name: ibm-mq-container
environment:
- LICENSE=accept
- MQ_QMGR_NAME=QM1
- MQ_APP_PASSWORD=password
- MQ_ADMIN_PASSWORD=password
ports:
- 1414:1414
- 9443:9443
volumes:
- qm1data:/mnt/mqm
networks:
- webapi_network
restart: unless-stopped
But it complains with
0.318 /go/pkg/mod/github.com/ibm-messaging/[email protected]/jms20subset/MQOptions.go:5:32: undefined: ibmmq.MQCNO
0.318 /go/pkg/mod/github.com/ibm-messaging/[email protected]/jms20subset/MQOptions.go:8:25: undefined: ibmmq.MQCNO
I’ve scoured the internet for a possible solution but can’t seem to find one. Does anyone know how to make mq-golang-jms20 work with ARM64 mq-container image? For context, this works fine with the older images built for AMD64 platform instead.