Skip to content

Commit

Permalink
modify to update OSs and to install Python 3.7 for Apama 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mjj29 committed Jul 16, 2019
1 parent f79f5a3 commit 7ed39a0
Show file tree
Hide file tree
Showing 20 changed files with 200 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions Apama10.5/Dockerfile.centos:7
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM centos:7 as builder

RUN yum install -y gcc openssl-devel bzip2-devel libffi-devel wget make
RUN wget -O /root/Python-3.7.4.tar.xz https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz && (cd /root; tar xf Python-3.7.4.tar.xz)
RUN (cd /root/Python-3.7.4; ./configure --enable-optimizations --enable-shared && make -j 8 build_all && make altinstall)

FROM centos:7

# Copy built python to fresh image
COPY --from=builder /usr/local /usr/local
ENV AP_PYTHONHOME=/usr/local

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
14 changes: 14 additions & 0 deletions Apama10.5/Dockerfile.debian:bullseye
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM debian:bullseye

# Install python from main repository
RUN apt-get update && apt-get install -y python3.7 libpython3.7
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
14 changes: 14 additions & 0 deletions Apama10.5/Dockerfile.debian:buster
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM debian:buster

# Install python from main repository
RUN apt-get update && apt-get install -y python3.7 libpython3.7
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
21 changes: 21 additions & 0 deletions Apama10.5/Dockerfile.debian:jessie
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM debian:jessie as builder

# download and build Python
RUN apt-get update && apt-get install -y libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev wget libffi-dev
RUN wget -O /root/Python-3.7.4.tar.xz https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz && (cd /root; tar xf Python-3.7.4.tar.xz)
RUN (cd /root/Python-3.7.4; ./configure --enable-optimizations --enable-shared && make -j 8 build_all && make altinstall)

FROM debian:jessie

# Copy built python to fresh image
COPY --from=builder /usr/local /usr/local
ENV AP_PYTHONHOME=/usr/local

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
18 changes: 18 additions & 0 deletions Apama10.5/Dockerfile.opensuse:leap
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM opensuse/leap:15.0 as builder

# download and build Python
RUN zypper --non-interactive install readline-devel sqlite3-devel libbz2-devel zlib-devel libopenssl-devel wget tar gcc make xz libffi-devel
RUN wget -O /root/Python-3.7.4.tar.xz https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz && (cd /root; tar xf Python-3.7.4.tar.xz)
RUN (cd /root/Python-3.7.4; ./configure --enable-optimizations --enable-shared && make -j 8 build_all && make altinstall)

ENV AP_PYTHONHOME=/usr/local

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]

14 changes: 14 additions & 0 deletions Apama10.5/Dockerfile.opensuse:tumbleweed
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM opensuse/tumbleweed

# Add Python from default repository
RUN zypper --non-interactive install python3
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
14 changes: 14 additions & 0 deletions Apama10.5/Dockerfile.ubuntu:bionic
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:bionic

# Install python from main repository
RUN apt-get update && apt-get install -y python3.7 libpython3.7
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
14 changes: 14 additions & 0 deletions Apama10.5/Dockerfile.ubuntu:cosmic
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:cosmic

# Install python from main repository
RUN apt-get update && apt-get install -y python3.7 libpython3.7
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
14 changes: 14 additions & 0 deletions Apama10.5/Dockerfile.ubuntu:disco
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:disco

# Install python from main repository
RUN apt-get update && apt-get install -y python3.7 libpython3.7
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
14 changes: 14 additions & 0 deletions Apama10.5/Dockerfile.ubuntu:eoan
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:eoan

# Install python from main repository
RUN apt-get update && apt-get install -y python3.7 libpython3.7
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]
16 changes: 16 additions & 0 deletions Apama10.5/Dockerfile.ubuntu:xenial
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:xenial

# Install from deadsnakes PPA
RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt-get update && apt-get install -y python3.7 libpython3.7
ENV AP_PYTHONHOME=/usr

# Add sample project to image
COPY core /opt/apamacore
COPY project /opt/project
COPY launch.sh /opt/launch.sh

# Launch image with correct settings to run project
ENTRYPOINT ["/opt/launch.sh"]
CMD ["correlator", "--config", "/opt/project"]


34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Apama core python installation in Docker

This project contains Dockerfile for installing Python 3.6 on various Linux
base images. It also contains a simple Apama project to demonstrate use of
this Python with Apama.
This project contains Dockerfile for installing Python 3.6 or 3.7 on various
Linux base images. It also contains a simple Apama project to demonstrate use
of this Python with Apama.

These Dockerfiles are mainly intended as ways to demonstrate installing an
appropriate Python on that distribution and the instructions contained within
will work for any installation of that distribution.

## License

Copyright (c) 2018 Software AG, Darmstadt, Germany and/or its licensors
Copyright (c) 2018-2019 Software AG, Darmstadt, Germany and/or its licensors

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
Expand All @@ -18,11 +22,13 @@ See the License for the specific language governing permissions and limitations

## Using the Dockerfiles

To use these Dockerfiles you will need a copy of the Apama 10.3 core
To use these Dockerfiles you will need a copy of the Apama core
installation from [http://www.apamacommunity.com](http://www.apamacommunity.com/). Unpack it into this directory
under a folder named 'core'.

Next, choose one of the following Linux distributions to use as your base image:
Next, choose one of the following Linux distributions to use as your base image.

For Apama 10.3:

* CentOS 7 (Installs Python from EPEL repository)
* Ubuntu Bionic (Installs Python from main repository)
Expand All @@ -33,9 +39,23 @@ Next, choose one of the following Linux distributions to use as your base image:
* Debian Jessie (Builds Python from source)
* OpenSuse Leap 42 (Builds Python from source)

For Apama 10.5:

* CentOS 7 (Builds Python from source)
* Ubuntu Bionic (Installs Python from main repository)
* Ubuntu Cosmic (Installs Python from main repository)
* Ubuntu Disco (Installs Python from main repository)
* Ubuntu Eoan (Installs Python from main repository)
* Debian Bullseye (Installs Python from main repository)
* Debian Buster (Installs Python from main repository)
* OpenSuse Tumbleweed (Installs Python from the main repository)
* OpenSuse Leap (Builds Python from Source)
* Ubuntu Xenial (Installs Python from a PPA)
* Debian Jessie (Builds Python from source)

Once you have chosen the distribution and release to use as a base image, build the image with:

docker build -t projectimage -f Dockerfile.distribution:release .
docker build -t projectimage -f Apama10.3/Dockerfile.distribution:release .

Once that has completed you can run the demo project in the docker image with:

Expand Down

0 comments on commit 7ed39a0

Please sign in to comment.