Skip to content

Commit

Permalink
Dockerfile: Remove debug build dirs before building the release version
Browse files Browse the repository at this point in the history
Remove the code from the debug builds, inside this container, to build
the release version from a clean build

Signed-off-by: Andre Riesco <[email protected]>
  • Loading branch information
andreriesco committed Feb 9, 2024
1 parent 472acd6 commit 0cad77b
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 7 deletions.
4 changes: 4 additions & 0 deletions cConsole/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ RUN apt-get -q -y update && \
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/build-${IMAGE_ARCH}

# Compile the application
RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \
make ARCH=${IMAGE_ARCH} CC=aarch64-linux-gnu-gcc ; \
Expand Down
3 changes: 3 additions & 0 deletions cmakeConsole/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ RUN apt-get -q -y update && \
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/build-${IMAGE_ARCH}

RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -Bbuild-${IMAGE_ARCH} ; \
Expand Down
4 changes: 4 additions & 0 deletions cppConsole/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ RUN apt-get -q -y update && \
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/build-${IMAGE_ARCH}

# Compile the application
RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \
make ARCH=${IMAGE_ARCH} CC=aarch64-linux-gnu-g++ ; \
Expand Down
4 changes: 4 additions & 0 deletions cppQML/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ RUN apt-get -q -y update && \
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/build-${IMAGE_ARCH}

RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -Bbuild-${IMAGE_ARCH} ; \
elif [ "$IMAGE_ARCH" = "arm" ] ; then \
Expand Down
3 changes: 1 addition & 2 deletions cppSlint/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
credentials.zip
build/*/CMakeFiles
credentials.zip
14 changes: 10 additions & 4 deletions cppSlint/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ ENV CMAKE_GENERATOR=Ninja
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

RUN mkdir -p build \
&& cd build \
&& cmake .. \
&& cmake --build .
# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/build

RUN cmake -DCMAKE_BUILD_TYPE=Release -B build/${IMAGE_ARCH} -S . \
&& cmake --build build/${IMAGE_ARCH}

# BUILD ------------------------------------------------------------------------

Expand Down Expand Up @@ -108,6 +110,10 @@ ENV SLINT_FULLSCREEN=1
# configuration defined in settings.json
COPY --from=Build ${APP_ROOT}/build/${IMAGE_ARCH} ${APP_ROOT}

# Remove the CMakeFiles directory, that is just needed for the build and not
# for the execution
RUN rm -rf ${APP_ROOT}/CMakeFiles

# "cd" (enter) into the APP_ROOT directory
WORKDIR ${APP_ROOT}

Expand Down
4 changes: 4 additions & 0 deletions cppSlint/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,8 @@ RUN rm -r /etc/ssh/ssh*key && \
# in settings.json.
COPY --chown=$SSHUSERNAME:$SSHUSERNAME ./build/${IMAGE_ARCH} ${APP_ROOT}

# Remove the CMakeFiles directory, that is just needed for the build and not
# for the execution
RUN rm -rf ${APP_ROOT}/CMakeFiles

CMD [ "/usr/sbin/sshd", "-D" ]
5 changes: 4 additions & 1 deletion nodeElectron/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ RUN npm install -g [email protected]

COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}
# Remove the out directory, that has the debug build

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/out


RUN npm install

# build the application
Expand Down
5 changes: 5 additions & 0 deletions nodeJSTypeScript/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ RUN npm install -g ts-node
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/out


RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \
npm run output-arm64; \
elif [ "$IMAGE_ARCH" = "arm" ] ; then \
Expand Down
5 changes: 5 additions & 0 deletions rustConsole/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ RUN rustup target add $(cat ~/rust-toolchain-arch.txt)
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/target


RUN TARGET=$(cat ~/rust-toolchain-arch.txt) && \
cargo build --release --target $TARGET && \
mkdir -p build && \
Expand Down
5 changes: 5 additions & 0 deletions rustSlint/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ ENV RUST_FONTCONFIG_DLOPEN=on
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/target


# BUILD ------------------------------------------------------------------------

RUN TARGET=$(cat /rust-toolchain-arch.txt) && \
Expand Down
4 changes: 4 additions & 0 deletions zigConsole/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ RUN chmod +x ${ZIG_PATH}/zig
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}

# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/target

# zig optimizers:
# (Debug | ReleaseSafe) w/ dbg-info + runtime stacktrace (compiler safety),
# (ReleaseSmall | ReleaseFast) no runtime stacktrace (undefined & fast)
Expand Down

0 comments on commit 0cad77b

Please sign in to comment.