Add dockerfiles

This commit is contained in:
2024-11-01 00:07:50 +01:00
parent c8d445ed6a
commit 4ce61f349f
15 changed files with 86 additions and 10 deletions

View File

@@ -1,3 +1,16 @@
build:
docker buildx build -t pymqi -f ubi9/Dockerfile.ubi9-mqclient ubi9/
docker buildx build -t ubi9python -f ubi9/Dockerfile.ubi9 ubi9/
make -C ../ build-devserver
push: build
docker tag pymqi git.cbo.dk/rasmus/mq-container:ubi9-mqclient
docker push git.cbo.dk/rasmus/mq-container:ubi9-mqclient
docker tag pymqi git.cbo.dk/rasmus/mq-container:ubi9
docker push git.cbo.dk/rasmus/mq-container:ubi9
docker tag ibm-mqadvanced-server-dev:9.4.1.0-amd64 git.cbo.dk/rasmus/mq-container:9.4.1.0-amd64
docker push git.cbo.dk/rasmus/mq-container:9.4.1.0-amd64
run: run:
kubectl delete pod mq-ubuntu-pod kubectl delete pod mq-ubuntu-pod
kubectl delete pvc mqm-pvc kubectl delete pvc mqm-pvc

View File

@@ -1,11 +1,6 @@
make build-devserver # Testing
docker tag ibm-mqadvanced-server-dev:9.4.1.0-amd64 git.cbo.dk/rasmus/mq-container:9.4.1.0-amd64
docker push git.cbo.dk/rasmus/mq-container:9.4.1.0-amd64
cd rln
make run
```bash ```bash
apt-get update && apt-get update -y && apt-get install -y python3 python3-pip python3-dev build-essential wget curl && pip install --break-system-packages pymqi make build
``` make push
make run
```

10
rln/ubi9/Dockerfile.ubi9 Normal file
View File

@@ -0,0 +1,10 @@
# docker buildx build -t pymqi . -f Dockerfile.ubi9
FROM registry.access.redhat.com/ubi9/python-312:1-25.1729767846
USER 0
RUN yum update -y \
&& yum install -y tar wget python3 python3-devel python3-pip
ENTRYPOINT ["tail", "-f", "/dev/null"]

View File

@@ -0,0 +1,21 @@
# docker buildx build -t pymqi . -f Dockerfile.ubi9-mqclient
FROM registry.access.redhat.com/ubi9/python-312:1-25.1729767846
USER 0
COPY ./mq/9.4.1.0-IBM-MQC-LinuxX64.tar.gz /tmp/IBM-MQC-LinuxX64.tar.gz
COPY ./mq/*.py /tmp
RUN yum update -y \
&& yum install -y tar wget python3 python3-devel python3-pip \
&& cd /tmp \
&& tar -xvf IBM-MQC-LinuxX64.tar.gz \
&& cd /tmp/MQClient \
&& ./mqlicense.sh -accept \
&& rpm -i *.rpm \
&& /opt/mqm/bin/setmqinst -i -p /opt/mqm \
&& source /opt/mqm/bin/setmqenv -l -p /opt/mqm \
&& pip install pymqi
ENTRYPOINT ["tail", "-f", "/dev/null"]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,13 @@
import pymqi
queue_manager = 'QM1'
queue_name = 'DEV.QUEUE1'
message = 'Hello from Python!'
qmgr = pymqi.connect(queue_manager)
queue = pymqi.Queue(qmgr, queue_name)
queue.put(message)
queue.close()
qmgr.disconnect()

17
rln/ubi9/mq/pymqi-tcp.py Normal file
View File

@@ -0,0 +1,17 @@
import pymqi
queue_manager = 'QM1'
channel = 'DEV.APP.SVRCONN'
host = '192.168.50.155'
port = '1414'
queue_name = 'DEV.QUEUE1'
message = 'Hello from Python!'
conn_info = '%s(%s)' % (host, port)
qmgr = pymqi.connect(queue_manager, channel, conn_info)
queue = pymqi.Queue(qmgr, queue_name)
queue.put(message)
queue.close()
qmgr.disconnect()

7
rln/ubi9/notes.md Normal file
View File

@@ -0,0 +1,7 @@
# Notes
Build ubi9 container with MQ client and pymqi installed.
```bash
docker buildx build -t pymqi . -f Dockerfile.ubi9
docker tag pymqi git.cbo.dk/rasmus/mq-container:ubi9-client
docker push git.cbo.dk/rasmus/mq-container:ubi9-client
```