CodeSYS-SL-Docker/Dockerfile

37 lines
1 KiB
Text
Raw Normal View History

2025-02-21 12:54:25 +01:00
FROM debian:bookworm
RUN apt-get update && apt-get install -y \
wget unzip \
libusb-1.0-0 procps
ARG CDS_VERSION=4.9.0.0
# Construct the URL with the variable
RUN mkdir -p /tmp/codesys && \
echo "https://store-archive.codesys.com/ftp_download/3S/LinuxSL/2302000005/${CDS_VERSION}/CODESYS%20Control%20for%20Linux%20SL%20${CDS_VERSION}.package" > /tmp/codesys/url.txt
# Download the package
RUN wget --output-document=codesys.package $(cat /tmp/codesys/url.txt)
# Clean up temporary files
RUN rm -rf /tmp/codesys
# Continue with unpacking and installation
RUN unzip -p codesys.package '*codemeter*.deb' > codemeter.deb && \
unzip -p codesys.package '*codesys*.deb' > codesys.deb
RUN dpkg -i codemeter.deb codesys.deb
# clean up the apt cache
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
# Remove Codesys packages
RUN rm -rf codesys.package codesys.deb codemeter.deb
EXPOSE 11740/tcp 11743/tcp 1217/tcp
WORKDIR /var/opt/codesys/
CMD [ "/opt/codesys/bin/codesyscontrol.bin", "/etc/CODESYSControl.cfg" ]