Table of Contents

About

This is a Docker build for the Corrade scripted agent.

Filesystem Layout

.
├── Dockerfile
└── rootfs
    └── usr
        └── local
            └── bin
                └── run

5 directories, 2 files

Dockerfile

File: https://svn.grimore.org/docker/build/corrade/Dockerfile -

# for libssl compatiblity required for .net 5.0
FROM debian:bullseye-slim
 
# update package manager
RUN  apt-get update -y && \
     apt-get upgrade -y && \
     apt-get dist-upgrade -y && \
     apt-get -y autoremove && \
     apt-get clean
 
# unzip required for unpacking Corrade and all the rest are libraries
RUN apt-get install -y \
    coreutils \
    bash \
    unzip \
    libgssapi-krb5-2 \
    libssl1.1 \
    libicu67
 
 
# retrieve latest Corrade
WORKDIR /tmp
RUN curl -fsSSL https://corrade.grimore.org/download/corrade/linux-x64/LATEST.zip?q=$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20; echo;) -o /tmp/Corrade.zip && \
    unzip /tmp/Corrade.zip -d /corrade
 
# open port declaration, in order: Nucleus, HTTP, MQTT, TCP, UDP and WebSockets
EXPOSE 54377 8080 1883 8085 8086 8088
 
# add filesystem requirements
ADD rootfs /
 
# execute the bootstrapper that will start Corrade
RUN ["chmod", "+x", "/usr/local/bin/run"]
ENTRYPOINT ["/usr/local/bin/run"]

Files

Here are the files associated with this Corrade build.

run

File: http://svn.grimore.org/docker/build/corrade/rootfs/usr/local/bin/run -

#!/usr/bin/env bash
 
# create a directory that will be mountable as a regular Docker volume
mkdir -p /etc/corrade
 
# now pivot user-editable files as a symlink into the Docker mountable volume directory
 
if [ ! -f /etc/corrade/CorradeConfiguration.xml ]; then
    cp /corrade/CorradeConfiguration.xml.default /etc/corrade/CorradeConfiguration.xml    
fi
ln -sf /etc/corrade/CorradeConfiguration.xml /corrade/CorradeConfiguration.xml
 
if [ ! -f /etc/corrade/NucleusConfiguration.xml ]; then
    cp /corrade/NucleusConfiguration.xml.default /etc/corrade/NucleusConfiguration.xml    
fi
ln -sf /etc/corrade/NucleusConfiguration.xml /corrade/NucleusConfiguration.xml
 
if [ ! -f /etc/corrade/Log4Net.config ]; then
    cp /corrade/Log4Net.config.default /etc/corrade/Log4Net.config    
fi
ln -sf /etc/corrade/Log4Net.config /corrade/Log4Net.config
 
/corrade/Corrade