-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
38 lines (37 loc) · 1.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM registry.access.redhat.com/ubi8/go-toolset:1.21 AS builder
ENV APP_HOME=/go/src/openshift-app-sample
USER 0
RUN mkdir -p /opt/mqm \
&& chmod a+rx /opt/mqm
# Location of the downloadable MQ client package \
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
VRMF=9.4.0.0
# Install the MQ client from the Redistributable package. This also contains the
# header files we need to compile against. Setup the subset of the package
# we are going to keep - the genmqpkg.sh script removes unneeded parts
ENV genmqpkg_incnls=1 \
genmqpkg_incsdk=1 \
genmqpkg_inctls=1
RUN cd /opt/mqm \
&& curl -LO "$RDURL/$VRMF-$RDTAR" \
&& tar -zxf ./*.tar.gz \
&& rm -f ./*.tar.gz \
&& bin/genmqpkg.sh -b /opt/mqm
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
COPY src/ .
RUN go build -o openshift-app-sample
FROM registry.access.redhat.com/ubi8/go-toolset:1.21
ENV APP_HOME=/go/src/openshift-app-sample
# Create the directories the client expects to be present
USER 0
RUN mkdir -p $APP_HOME \
&& mkdir -p /IBM/MQ/data/errors \
&& mkdir -p /.mqm \
&& chmod -R 777 /IBM \
&& chmod -R 777 /.mqm
WORKDIR $APP_HOME
COPY --chown=0:0 --from=builder $APP_HOME/openshift-app-sample $APP_HOME
COPY --chown=0:0 --from=builder /opt/mqm /opt/mqm
CMD ["./openshift-app-sample"]