Add MQ and Go SDK images
This commit is contained in:
33
incubating/mq-golang-sdk/Dockerfile
Normal file
33
incubating/mq-golang-sdk/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
# © Copyright IBM Corporation 2018
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ARG BASE_IMAGE=mq-sdk:9.0.5.0-x86_64-ubuntu-16.04
|
||||
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
ENV GO_VERSION=1.10
|
||||
|
||||
# Install the Go compiler and Git
|
||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
&& bash -c 'source /etc/os-release; \
|
||||
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME} main restricted" > /etc/apt/sources.list; \
|
||||
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-updates main restricted" >> /etc/apt/sources.list; \
|
||||
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-backports main restricted universe" >> /etc/apt/sources.list;' \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends golang-${GO_VERSION} git ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV PATH="${PATH}:/usr/lib/go-${GO_VERSION}/bin"
|
||||
ENV CGO_CFLAGS="-I/opt/mqm/inc/"
|
||||
ENV CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"
|
||||
5
incubating/mq-golang-sdk/README.md
Normal file
5
incubating/mq-golang-sdk/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# IBM MQ Software Developer Kit (SDK) with Go
|
||||
|
||||
This image contains the MQ SDK, Git, the Go compiler, and the `build-essential` package (which includes GNU C and C++ compilers plus other essential tools like `make`).
|
||||
|
||||
This image doesn't contain any Go code for MQ. You can add a CGO wrapper for the MQ C client, for example [mq-golang](https://github.com/ibm-messaging/mq-golang), via your vendor directory, or directly using `go get`.
|
||||
33
incubating/mq-sdk/Dockerfile
Normal file
33
incubating/mq-sdk/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
# © Copyright IBM Corporation 2018
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM ubuntu:16.04
|
||||
|
||||
# The URL to download the MQ installer from in tar.gz format
|
||||
# This assumes an archive containing the MQ Debian (.deb) install packages
|
||||
ARG MQ_URL
|
||||
|
||||
# The packages to install in install-mq.sh
|
||||
ENV MQ_PACKAGES="ibmmq-sdk ibmmq-samples build-essential"
|
||||
|
||||
COPY install-mq.sh /usr/local/bin/
|
||||
|
||||
# Install MQ. To avoid a "text file busy" error here, we sleep before installing.
|
||||
# Need to re-instate the `/var/mqm` directory after installation, to avoid MQ
|
||||
# errors with some commands (e.g. `dspmqver`)
|
||||
RUN chmod u+x /usr/local/bin/install-mq.sh \
|
||||
&& sleep 1 \
|
||||
&& install-mq.sh \
|
||||
&& rm -rf /var/mqm \
|
||||
&& /opt/mqm/bin/crtmqdir -f -s
|
||||
13
incubating/mq-sdk/README.md
Normal file
13
incubating/mq-sdk/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# IBM MQ Software Developer Kit (SDK)
|
||||
|
||||
This image contains the MQ SDK and the `build-essential` package, which includes GNU C and C++ compilers plus other essential tools.
|
||||
|
||||
## Usage
|
||||
|
||||
For example, you could compile the `amqsput0.c` sample program by running the following command in an SDK container:
|
||||
|
||||
```sh
|
||||
gcc -o /tmp/amqsput0 /opt/mqm/samp/amqsput0.c -I /opt/mqm/inc -L /opt/mqm/lib64 -lmqm
|
||||
```
|
||||
|
||||
Compiler and linker output is placed on the container's filesystem, so using multi-stage Docker builds is useful to build a final container.
|
||||
Reference in New Issue
Block a user