Andras Fekete 1 год назад
Родитель
Сommit
c1ad3457f3
2 измененных файлов с 8 добавлено и 1 удалено
  1. 7 0
      Docker/Dockerfile
  2. 1 1
      Docker/run.sh

+ 7 - 0
Docker/Dockerfile

@@ -1,3 +1,10 @@
 FROM ubuntu:22.04
 
 RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y build-essential autoconf libtool
+
+ARG USER=docker
+ARG UID=1000
+ARG GID=1000
+RUN groupadd -g ${GID} docker && useradd -ms /bin/bash ${USER} -u ${UID} -g ${GID}
+
+USER ${UID}:${GID}

+ 1 - 1
Docker/run.sh

@@ -1,5 +1,5 @@
 echo "Running with \"${@}\"..."
-docker build -t wolfssl . && \
+docker build -t wolfssl --build-arg UID=$(id -u) --build-arg GID=$(id -g) . && \
 docker run -it -v $(pwd)/..:/tmp/wolfssl -w /tmp/wolfssl wolfssl /bin/bash -c "./autogen.sh && ./configure $(echo ${@}) && make && ./testsuite/testsuite.test" && \
 docker run -it -v $(pwd)/..:/tmp/wolfssl -w /tmp/wolfssl wolfssl /bin/bash
 echo "Exited with error code $?"