summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-06-06 18:27:54 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-06-06 23:09:58 (GMT)
commit7c45f185a32c7bcff47c8fda1acdec82d3213717 (patch)
tree53b0419fe2a19e6ec5c89d0be0a11dcd8d4ceb00 /docker
parent94b1b330fc1f6e941a797fedabade4e790e28bc2 (diff)
parent35dcf8c8607483c104711c9398d47d57147f4389 (diff)
Merge remote-tracking branch 'origin/develop' into analog24
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile19
-rwxr-xr-xdocker/build.sh16
-rwxr-xr-xdocker/post_build.sh.in10
3 files changed, 20 insertions, 25 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 0a4f69f..f2d187d 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
@@ -11,21 +11,27 @@ RUN apt-get update -qq \
make \
python3 \
python3-pip \
+ python-is-python3 \
tar \
unzip \
- wget \
-# aarch64 packages
+ wget \
+ curl \
+ # aarch64 packages
libffi-dev \
libssl-dev \
python3-dev \
- python \
git \
+ apt-utils \
+ && curl -sL https://deb.nodesource.com/setup_18.x | bash - \
+ && apt-get install -y nodejs \
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/*;
# Git needed for PROJECT_GIT_COMMIT_HASH variable setting
RUN pip3 install adafruit-nrfutil
RUN pip3 install -Iv cryptography==3.3
+RUN pip3 install cbor
+RUN npm i lv_font_conv@1.5.2 -g
# build.sh knows how to compile
COPY build.sh /opt/
@@ -38,10 +44,5 @@ RUN bash -c "source /opt/build.sh; GetNrfSdk;"
# McuBoot
RUN bash -c "source /opt/build.sh; GetMcuBoot;"
-ARG PUID=1000
-ARG PGID=1000
-RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime
-
-USER infinitime:infinitime
ENV SOURCES_DIR /sources
CMD ["/opt/build.sh"]
diff --git a/docker/build.sh b/docker/build.sh
index d86e7c2..878d9ec 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -9,7 +9,7 @@ set -e
export TOOLS_DIR="${TOOLS_DIR:=/opt}"
export SOURCES_DIR="${SOURCES_DIR:=/sources}"
export BUILD_DIR="${BUILD_DIR:=$SOURCES_DIR/build}"
-export OUTPUT_DIR="${OUTPUT_DIR:=$BUILD_DIR/output}"
+export OUTPUT_DIR="${OUTPUT_DIR:=$SOURCES_DIR/build/output}"
export BUILD_TYPE=${BUILD_TYPE:=Release}
export GCC_ARM_VER=${GCC_ARM_VER:="gcc-arm-none-eabi-9-2020-q2-update"}
@@ -22,7 +22,7 @@ main() {
local target="$1"
mkdir -p "$TOOLS_DIR"
-
+
[[ ! -d "$TOOLS_DIR/$GCC_ARM_VER" ]] && GetGcc
[[ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]] && GetNrfSdk
[[ ! -d "$TOOLS_DIR/mcuboot" ]] && GetMcuBoot
@@ -31,7 +31,7 @@ main() {
CmakeGenerate
CmakeBuild $target
- BUILD_RESULT=$?
+ BUILD_RESULT=$?
if [ "$DISABLE_POSTBUILD" != "true" -a "$BUILD_RESULT" == 0 ]; then
source "$BUILD_DIR/post_build.sh"
fi
@@ -54,18 +54,14 @@ GetNrfSdk() {
}
CmakeGenerate() {
- # We can swap the CD and trailing SOURCES_DIR for -B and -S respectively
- # once we go to newer CMake (Ubuntu 18.10 gives us CMake 3.10)
- cd "$BUILD_DIR"
-
cmake -G "Unix Makefiles" \
+ -S "$SOURCES_DIR" \
+ -B "$BUILD_DIR" \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DUSE_OPENOCD=1 \
-DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_VER" \
-DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \
- -DBUILD_DFU=1 \
- "$SOURCES_DIR"
- cmake -L -N .
+ -DBUILD_DFU=1
}
CmakeBuild() {
diff --git a/docker/post_build.sh.in b/docker/post_build.sh.in
index db6e7a9..8c94471 100755
--- a/docker/post_build.sh.in
+++ b/docker/post_build.sh.in
@@ -15,12 +15,10 @@ cp "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/p
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin"
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"
-
mkdir -p "$OUTPUT_DIR/src"
-cd "$BUILD_DIR"
-cp src/*.bin "$OUTPUT_DIR/src"
-cp src/*.hex "$OUTPUT_DIR/src"
-cp src/*.out "$OUTPUT_DIR/src"
-cp src/*.map "$OUTPUT_DIR/src"
+cp $BUILD_DIR/src/*.bin "$OUTPUT_DIR/src/"
+cp $BUILD_DIR/src/*.hex "$OUTPUT_DIR/src/"
+cp $BUILD_DIR/src/*.out "$OUTPUT_DIR/src/"
+cp $BUILD_DIR/src/*.map "$OUTPUT_DIR/src/"
ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g' \ No newline at end of file