From b24b8ad096315873bd0f884ce9898d96b4786025 Mon Sep 17 00:00:00 2001 From: Lauri Koskela Date: Sun, 28 Aug 2022 18:21:22 +0300 Subject: [PATCH] Docker fixes (#1357) * Update Dockerfile to Ubuntu 22.04 * Fix git directory ownership check with docker build * Add .dockerignore that ignores everything Building the Docker image requires no files from the repo. To avoid slow Docker context copying when building the image, ignore all files. --- .dockerignore | 2 ++ Dockerfile | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..241e560df6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +* + diff --git a/Dockerfile b/Dockerfile index bea63cb110..edc487ef68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:21.10 as build +FROM ubuntu:22.04 as build ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ @@ -26,5 +26,7 @@ ENV LANG C.UTF-8 RUN mkdir /oot WORKDIR /oot +RUN git config --global --add safe.directory /oot + CMD ["/bin/sh", "-c", \ "echo 'usage:\n docker run --rm --mount type=bind,source=\"$(pwd)\",destination=/oot oot make -j$(nproc) setup\n docker run --rm --mount type=bind,source=\"$(pwd)\",destination=/oot oot make -j$(nproc)'"]