Skip to content

The Dockerfile

ibm-om edited this page Jun 16, 2016 · 6 revisions

The Dockerfile can be used with DataPower Gateway .deb and .rpm files to create a Docker image.
You can copy a sample provided and save it as a file named Dockerfile (with no file extension).

Entries in the Dockerfile can set parameters in the datapower.conf file to control configuration of the DataPower Gateway. More detailed information is available at the IBM DataPower Gateway Knowledge Center.

Note: You must ensure that the file names and information in the Dockerfile matches your environment.

Sample Dockerfiles for Ubuntu and RHEL are provided here, and a line by line description follows them.

Ubuntu sample Dockerfile

FROM ubuntu:trusty
COPY ibm-datapower-common.deb ibm-datapower-image.deb /tmp/
ENV DEBIAN_FRONTEND noninteractive
RUN \
    && apt-get update \
    && apt-get -y install \
          kpartx \
          schroot \
          telnet \
    && dpkg -i /tmp/ibm-datapower-common.deb /tmp/ibm-datapower-image.deb \
    && sed -i \
          -e ’/^web-mgmt/,/^exit/s/admin-state.*/admin-state "enabled"/g’ \
          /opt/ibm/datapower/datapower-external.cfg \
    && rm /tmp/ibm-datapower-common.deb /tmp/ibm-datapower-image.deb \
    && /opt/ibm/datapower/datapower-docker-build.sh \
    && mkdir -p /datapower/config /datapower/local \
    && echo "DataPowerConfigDir=/datapower/config" >> /opt/ibm/datapower/datapower.conf \
    && echo "DataPowerLocalDir=/datapower/local" >> /opt/ibm/datapower/datapower.conf \
    && echo "DataPowerCpuCount=4" >> /opt/ibm/datapower/datapower.conf  \
    && echo "DataPowerMemoryLimit=8000" >> /opt/ibm/datapower/datapower.conf
EXPOSE 9090
CMD ["/opt/ibm/datapower/datapower-launch"]  

RHEL sample Dockerfile

FROM rhel7.2
COPY ibm-datapower-common.rpm ibm-datapower-image.rpm /tmp/
RUN \
    && yum -y update \
    && yum -y install \
          kpartx \
          schroot \
          telnet \
    && yum -y install /tmp/ibm-datapower-image.rpm \
    && yum -y install /tmp/ibm-datapower-common.rpm \
    && sed -i \
          -e ’/^web-mgmt/,/^exit/s/admin-state.*/admin-state "enabled"/g’  \
          /opt/ibm/datapower/datapower-external.cfg \
    && rm /tmp/ibm-datapower-common.rpm  tmp/ibm-datapower-image.rpm \
    && /opt/ibm/datapower/datapower-docker-build.sh \
    && mkdir -p /datapower/config /datapower/local \
    && echo "DataPowerConfigDir=/datapower/config" >> /opt/ibm/datapower/datapower.conf \
    && echo "DataPowerLocalDir=/datapower/local" >> /opt/ibm/datapower/datapower.conf \
    && echo "DataPowerCpuCount=4" >> /opt/ibm/datapower/datapower.conf \
    && echo "DataPowerCpuCount=4" >> /opt/ibm/datapower/datapower.conf  \
    && echo "DataPowerMemoryLimit=8000" >> /opt/ibm/datapower/datapower.conf
EXPOSE 9090    
CMD ["/opt/ibm/datapower/datapower-launch"]

Line by line description of the Ubuntu sample Dockerfile

FROM ubuntu:trusty  

Specifies the base image, ubuntu:trusty, with the goal to install the Debian packages.

COPY ibm-datapower-common.deb ibm-datapower-image.deb /tmp/  

Copies the Debian packages into the container so that they can be installed. The file names must match entries in the Dockerfile. You can change the file names or edit the Dockerfile.

ENV DEBIAN_FRONTEND noninteractive
RUN \
&& apt-get update \
&& apt-get -y install \
      kpartx \
      schroot \
      telnet \  

Installs DataPower dependencies.

&& dpkg -i /tmp/ibm-datapower-common.deb /tmp/ibm-datapower-image.deb \  

Installs the DataPower Gateway.

&& sed -i \
      -e ’/^web-mgmt/,/^exit/s/admin-state.*/admin-state "enabled"/g’ \
      /opt/ibm/datapower/datapower-external.cfg \  

Enables the DataPower web management service.

&& rm /tmp/ibm-datapower-common.deb /tmp/ibm-datapower-image.deb \  

Removes temporary files.

&& /opt/ibm/datapower/datapower-docker-build.sh \  

Completes the installation. This required command takes several minutes to complete.

&& mkdir -p /datapower/config /datapower/local \  
&& echo "DataPowerConfigDir=/datapower/config" >> /opt/ibm/datapower/datapower.conf \
&& echo "DataPowerLocalDir=/datapower/local" >> /opt/ibm/datapower/datapower.conf \  

Configures optional directory mappings for external access to the DataPower Gateway file system.

&& echo "DataPowerCPUcount=4" >> /opt/ibm/datapower/datapower.conf \
&& echo "DataPowerMemoryLimit=8192" >> /opt/ibm/datapower/datapower.conf  

Adds resource configuration to the /opt/ibm/datapower/datapower.conf file.

EXPOSE 9090  

Advertises the DataPower web management port.

CMD ["/opt/ibm/datapower/datapower-launch"]  

Starts the DataPower Gateway inside the container.

Clone this wiki locally