a b/trunk/wharfie/examples/CODESYS/Wharfile
1
#
2
# This is an example of a Wharfie image
3
# with CODESYS.
4
#
5
6
FROM debian_armel_stretch
7
TO raspberrypi.tar
8
9
#
10
# Base System
11
#
12
# Update the system and install desired tools
13
RUN apt-get update
14
RUN apt-get install -y --no-install-recommends systemd-sysv openssh-server net-tools wireless-tools kmod wpasupplicant dhcpcd5
15
16
# Add user 'wharfie' with password 'wharfie' for interactive login
17
RUN useradd -ms /bin/bash wharfie; echo "wharfie:wharfie" | chpasswd; echo "root:root" | chpasswd;
18
19
# Add fstab
20
ADD ../common/files/fstab /etc/fstab
21
22
# Change Hostname
23
RUN HOST [ -f /usr/share/dict/words ] && printf "Wharfie-%s" $(grep '^[A-Z]' /usr/share/dict/words | sed -n "$(expr ${RANDOM} % $(grep '^[A-Z]' /usr/share/dict/words | wc -l))p" | sed "s,'.*,,") > etc/hostname
24
25
#
26
# Wireless
27
#
28
# Add files for wireless network configuration
29
ADD ../common/files/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
30
ADD ../common/files/wireless.conf /etc/modules-load.d/wireless.conf
31
RUN sed -i 's,^Requires,#Requires,' /lib/systemd/system/wpa_supplicant@.service
32
RUN systemctl enable wpa_supplicant@wlan0.service
33
34
#
35
# Add CODESYS package
36
#
37
# download package and extract it
38
RUN HOST \
39
    [ ! -f ../../common/files/codesys.package ] && wget --output-document=../../common/files/codesys.package 'https://store.codesys.com/ftp_download/3S/RaspberryPI_SL/603001/3.5.11.20/CODESYS%20Control%20for%20Raspberry%20PI%203.5.11.20.package' || true; \
40
    [ ! -f ../../common/files/codesys.deb ] && unzip -p ../../common/files/codesys.package '*.deb' > ../../common/files/codesys.deb || true; \
41
    cp ../../common/files/codesys.deb tmp/codesys.deb
42
43
# install
44
RUN dpkg -i /tmp/codesys.deb
45
46
# workaround for using binaries, built for Raspbian on an Raspi 1 / Zero / ...
47
RUN [ ! -f ld-linux-armhf.so.3 ] && ln -s /lib/ld-linux.so.3 /lib/ld-linux-armhf.so.3 || true
48
49
#
50
# Legal stuff
51
#
52
# Opational packages, which are containing
53
# legal stuff and a toolchain to do cross builds.
54
#SOURCE sources.tar
55
#LICENSE license.tar
56
#TOOLCHAIN toolchain.tar
57
58
#
59
# Bootstrategy: Raspberry PI
60
#
61
RUN HOST \
62
    ../../bootstrategy/raspberrypi.sh rpi.img
63