Add docker files for building tests on various distros.
diff --git a/tests/docker_images/README.md b/tests/docker_images/README.md
new file mode 100644
index 0000000..a83a8c1
--- /dev/null
+++ b/tests/docker_images/README.md
@@ -0,0 +1,17 @@
+Docker files
+------------
+
+This folder contains docker files that are used in testing nanopb automatically
+on various platforms.
+
+By default they take the newest master branch code from github.
+
+To build tests for a single target, use for example:
+
+    docker build ubuntu1804
+
+To build tests for all targets, use:
+
+    ./build_all.sh
+
+
diff --git a/tests/docker_images/build_all.sh b/tests/docker_images/build_all.sh
new file mode 100755
index 0000000..0c20464
--- /dev/null
+++ b/tests/docker_images/build_all.sh
@@ -0,0 +1,8 @@
+#!/bin/bash -e
+
+# Run all targets
+for file in `ls */Dockerfile`
+do echo -e "\n\n\n---------------------------------------- Building image for" $file " -------------------------------------------\n\n\n"
+docker build $(dirname $file)
+done
+
diff --git a/tests/docker_images/ubuntu1804/Dockerfile b/tests/docker_images/ubuntu1804/Dockerfile
new file mode 100644
index 0000000..27efc49
--- /dev/null
+++ b/tests/docker_images/ubuntu1804/Dockerfile
@@ -0,0 +1,15 @@
+FROM ubuntu:bionic
+
+RUN apt -y update
+RUN apt -y upgrade
+RUN apt -y dist-upgrade
+RUN apt -y autoremove
+RUN apt -y install --fix-missing
+RUN apt -y install apt-utils
+
+RUN apt -y install git scons build-essential g++
+RUN apt -y install protobuf-compiler python python-protobuf
+
+RUN git clone https://github.com/nanopb/nanopb.git
+RUN cd nanopb/tests && scons
+
diff --git a/tests/docker_images/ubuntu2004/Dockerfile b/tests/docker_images/ubuntu2004/Dockerfile
new file mode 100644
index 0000000..cb71ed0
--- /dev/null
+++ b/tests/docker_images/ubuntu2004/Dockerfile
@@ -0,0 +1,16 @@
+FROM ubuntu:focal
+
+RUN apt -y update
+RUN apt -y upgrade
+RUN apt -y dist-upgrade
+RUN apt -y autoremove
+RUN apt -y install --fix-missing
+RUN apt -y install apt-utils
+
+RUN apt -y install git scons build-essential g++
+RUN apt -y install protobuf-compiler python3.8 python3-protobuf
+RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && update-alternatives --set python /usr/bin/python3.8
+
+RUN git clone https://github.com/nanopb/nanopb.git
+RUN cd nanopb/tests && scons
+