From a1c65372873fe99765a9635a52597f350d436611 Mon Sep 17 00:00:00 2001
From: Giacomo Caironi <giacomo.caironi@gmail.com>
Date: Sat, 11 Nov 2023 10:40:46 +0100
Subject: [PATCH] Test custom dockerfile

---
 .gitlab-ci.yml | 14 +-------------
 Dockerfile     | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 13 deletions(-)
 create mode 100644 Dockerfile

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index da09bdea6..e0014190f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,7 +19,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 # THE SOFTWARE.
 
-image: ubuntu:latest
+image: registry.skywarder.eu/avn/swd/obsw/miosix:latest
 
 variables:
   GIT_SUBMODULE_STRATEGY: recursive
@@ -46,10 +46,6 @@ lint:
 
 build-debug:
   stage: build
-  before_script:
-    - apt update && apt install -y sudo cmake ninja-build ccache wget xz-utils
-    - wget https://miosix.org/toolchain/MiosixToolchainInstaller.run
-    - sh MiosixToolchainInstaller.run
   cache:
     - key: "ninja_cache-debug"
       paths:
@@ -61,10 +57,6 @@ build-debug:
 
 build-release:
   stage: build
-  before_script:
-    - apt update && apt install -y sudo cmake ninja-build ccache wget xz-utils
-    - wget https://miosix.org/toolchain/MiosixToolchainInstaller.run
-    - sh MiosixToolchainInstaller.run
   cache:
     - key: "ninja_cache-release"
       paths:
@@ -76,9 +68,5 @@ build-release:
 
 # test:
 #   stage: test
-#   before_script:
-#     - apt update && apt install -y sudo cmake ninja-build ccache build-essential wget xz-utils
-#     - wget https://miosix.org/toolchain/MiosixToolchainInstaller.run
-#     - sh MiosixToolchainInstaller.run
 #   script:
 #     - ./sbs --test catch-tests-main
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..526a17728
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,18 @@
+FROM ubuntu:20.04
+
+# Configure timezone
+ENV TZ=Europe/Rome
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+# Install required packages
+RUN apt-get update
+RUN apt-get install -y sudo
+RUN apt-get install -y build-essential
+RUN apt-get install -y cmake 
+RUN apt-get install -y ninja-build 
+RUN apt-get install -y ccache 
+RUN apt-get install -y xz-utils
+
+# Setup Miosix
+ADD https://miosix.org/toolchain/MiosixToolchainInstaller.run MiosixToolchainInstaller.run
+RUN sh MiosixToolchainInstaller.run
-- 
GitLab