Bläddra i källkod

Fix docker build and git ownership issue (#228)

baiywt 1 vecka sedan
förälder
incheckning
ad7c5192c4
2 ändrade filer med 12 tillägg och 10 borttagningar
  1. 3 2
      external/config/templates/Dockerfile
  2. 9 8
      external/config/templates/config-docker.conf

+ 3 - 2
external/config/templates/Dockerfile

@@ -1,4 +1,4 @@
-FROM ubuntu:21.04
+FROM ubuntu:22.04
 ARG DEBIAN_FRONTEND=noninteractive
 RUN apt-get update && apt-get -y install \
        joe \
@@ -45,7 +45,6 @@ RUN apt-get update \
        f2fs-tools \
        fakeroot \
        flex \
-       g++-8-arm-linux-gnueabihf \
        gawk \
        gcc-arm-linux-gnueabihf \
        gcc-arm-linux-gnueabi \
@@ -114,6 +113,8 @@ RUN apt-get update \
     && rm -rf /var/lib/apt/lists/*
 RUN locale-gen en_US.UTF-8
 
+RUN git config --system --add safe.directory /root/orangepi
+
 # Static port for NFSv3 server used for USB FEL boot
 RUN sed -i 's/\(^STATDOPTS=\).*/\1"--port 32765 --outgoing-port 32766"/' /etc/default/nfs-common \
     && sed -i 's/\(^RPCMOUNTDOPTS=\).*/\1"--port 32767"/' /etc/default/nfs-kernel-server

+ 9 - 8
external/config/templates/config-docker.conf

@@ -11,14 +11,15 @@
 mkdir -p $SRC/{output,userpatches}
 grep -q '^docker:' /etc/group && chgrp --quiet docker $SRC/{output,userpatches}
 chmod --quiet g+w,g+s $SRC/{output,userpatches}
-VERSION=$(cat $SRC/VERSION)
-if grep -q $VERSION <(grep armbian <(docker images)); then
-  display_alert "Using existed a armbian Docker container"
+VERSION=latest
+
+if grep -q $VERSION <(grep orangepi <(docker images)); then
+  display_alert "Using existed a orangepi Docker container"
 else
   # build a new container based on provided Dockerfile
   display_alert "Docker container not found or out of date"
   display_alert "Building a Docker container"
-  if ! docker build -t armbian:$VERSION . ; then
+  if ! docker build -t orangepi:$VERSION . ; then
     STATUS=$?
     # Adding a newline, so the alert won't be shown in the same line as the error
     echo
@@ -77,10 +78,10 @@ fi
 #DOCKER_FLAGS+=(-v /dev/bus/usb:/dev/bus/usb:ro)
 
 # map source to Docker Working dir.
-DOCKER_FLAGS+=(-v=$SRC/:/root/armbian/)
+DOCKER_FLAGS+=(-v=$SRC/:/root/orangepi/)
 
 # mount 2 named volumes - for cacheable data and compiler cache
-DOCKER_FLAGS+=(-v=armbian-cache:/root/armbian/cache -v=armbian-ccache:/root/.ccache)
+DOCKER_FLAGS+=(-v=orangepi-cache:/root/orangepi/cache -v=orangepi-ccache:/root/.ccache)
 
 DOCKER_FLAGS+=(-e COLUMNS="`tput cols`" -e LINES="`tput lines`")
 
@@ -106,10 +107,10 @@ If you prefer to use profile, for example, `userpatches/config-my.conf`,  try:
     ./compile.sh my compile_uboot
 
 EOF
-  docker run "${DOCKER_FLAGS[@]}" -it --entrypoint /usr/bin/env armbian:$VERSION "$@" /bin/bash
+  docker run "${DOCKER_FLAGS[@]}" -it --entrypoint /usr/bin/env orangepi:$VERSION "$@" /bin/bash
 else
   display_alert "Running the container" "" "info"
-  docker run "${DOCKER_FLAGS[@]}" -it armbian:$VERSION "$@"
+  docker run "${DOCKER_FLAGS[@]}" -it orangepi:$VERSION "$@"
 fi
 
 # Docker error treatment