PreEmptive does not provide pre-built Docker containers for our products, but it is a straightforward process to create your own containers with the distributions we provide. Keep in mind that you must use a Floating License for these containers.
Below is a sample Dockerfile for JSDefender as a starting point for building your containers. You will need to replace {x.y[.z]} with the appropriate major.minor[.patch] version.
Dockerfile:
FROM adoptopenjdk:11.0.8_10-jdk-hotspot
ARG DASHO_BASE="/opt/PreEmptive_Protection_DashO_{x.y}"
ENV DASHO_HOME="${DASHO_BASE}/app"\
JDK_HOME="/opt/java/openjdk"
# Extract the installer
ADD PreEmptive_Protection_DashO_{x.y.z}.tar.gz $DASHO_BASE
# Link the extracted directory to the standard installation location.
RUN ln -s “$DASHO_BASE/PreEmptive Protection DashO {x.y}” “$DASHO_HOME”
# Set up to run the command line interface
ENTRYPOINT ["/opt/PreEmptive_Protection_DashO_{x.y}/app/dashocmd"]To build this image:
- Save your
Dockerfilein the directory of your choice, and make sure you know where it is. - Download the
PreEmptive_Protection_DashO_{x.y.z}.tar.gzarchive from PreEmptive. - Place
PreEmptive_Protection_DashO_{x.y.z}.tar.gzin the same directory as Dockerfile (listed above). - Run
docker build -t preemptive/dasho:{x.y.z} {path to the directory containing 'Dockerfile'}.
Running the DashO container is simple; you just need to pass the license information. This can either be mirrored from the current environment:
docker run --rm -e DASHO_LICENSE -v {projectPath}:/code preemptive/dasho:{x.y.z} /code/project.doxIf you are running the container for Android, use the following command:
docker run --rm -e DASHO_LICENSE -v {projectPath}:/code -v {ANDROID_SDK_PATH}:{ANDROID_SDK_PATH} preemptive/dasho:{x.y.z} --pathMap {PATHMAP_PATH} --properties {PROPERTIES_PATH} /code/project.doxSet in the container’s environment:
docker run --rm -e DASHO_LICENSE={LicenseString} -v {projectPath}:/code preemptive/dasho:{x.y.z} /code/project.doxOr passed via the command line:
docker run --rm -v {projectPath}:/code preemptive/dasho:{x.y.z} --license {LicenseString} /code/project.doxAdditional arguments can be found here.