Configuration for Docker

The following example shows a dockerfile configured to install ActivePython and install and configure the Security & Compliance plugin.

  1. Create a new directory for your Docker project. For example: ~/AP35_Docker.
  2. Create a file named dockerfile in this folder and copy in the contents of the Dockerfile example codeblock.
  3. Download and save the Security & Compliance plugin to your Docker project directory.
  4. Create an identity in the ActiveState Platform to store and save the associated activestate.config file in your Docker project directory.
  5. On the command line, switch to the Docker project directory.
  6. Build the Docker image:

    # Remove any intermediate containers that are built and tag (name) the image
    docker build -rm -t activepython-plugin-354 .
  7. Run the Docker image:

    # Run the docker image interactively and start with the command prompt
    docker run -it activepython-plugin-354 /bin/bash

Dockerfile example

FROM centos:7

RUN yum -y install wget

WORKDIR /var/tmp

RUN wget
RUN tar xf /var/tmp/ActivePython-
WORKDIR /var/tmp/ActivePython-
RUN /bin/ash ./ --install-dir /opt/ActivePython-3.5
RUN echo export PATH=/opt/ActivePython-3.5/bin:\$PATH > /etc/profile.d/

RUN rm -rf /var/tmp/ActivePython-
RUN rm -rf /var/tmp/ActivePython-

ENV PATH /opt/ActivePython-3.5/bin:$PATH

RUN cd /usr/local/bin \
    && ln -s /opt/ActivePython-3.5/bin/python3 python \
    && ln -s /opt/ActivePython-3.5/bin/pip3 pip


COPY ./ActiveState-SecurityScanner-0.5.5.tar.gz /var/tmp
RUN pip install --upgrade pip
RUN pip install /var/tmp/ActiveState-SecurityScanner-0.5.5.tar.gz
COPY ./activestate.config /etc/activestate.config