Copy the Configuration File with Dockerfile

Create shellhttpd.conf in your local container repository in the shellhttpd folder, which holds your Dockerfile:

echo -e 'PORT=8080\nMSG="Hello from the file copied in the Dockerfile"' > shellhttpd/shellhttpd.conf

Verify the shellhttpd.conf file:

cat shellhttpd/shellhttpd.conf
PORT=8080
MSG="Hello from the file copied in the Dockerfile"

Edit the Dockerfile to create the shellhttpd folder and copy shellhttpd.conf to it:

vi shellhttpd/Dockerfile
FROM alpine

RUN mkdir /home/shellhttpd/

COPY shellhttpd.conf /home/shellhttpd/

COPY httpd.sh /usr/local/bin/

CMD ["/usr/local/bin/httpd.sh"]

Commit and push the changes.

git status
git add shellhttpd/shellhttpd.conf
git add shellhttpd/httpd.sh
git add shellhttpd/Dockerfile
git commit -m "Adding config file with Dockerfile"
git push

Wait for the FoundriesFactory® CI job to finish and for your device to receive the new target.

To check if your device is up-to-date, from your Factory page check Devices. You should see a new number at the end of the Target name. For example, raspberrypi3-64-lmp-5.

When the device is up-to-date, the Status icon will change to green.

../../_images/devices.png

Fig. 17 Device list

Test the container from an external device connected to the same network, such as your computer:

curl <Device IP>:8080
Hello from the file copied in the Dockerfile