From de99ef0d114187a4578089847c166b68e121ef2e Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 15 Jun 2025 16:40:43 +1200 Subject: [PATCH] 'Generic Commit' --- .dockerignore | 51 ++++++++++++++++++++++++++++++++++++++ Dockerfile.dropshell-build | 15 ++++++++--- src/main.cpp | 2 +- 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..870d5f1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,51 @@ +# Build outputs +output/ +*.o +*.a +*.so +*.exe + +# Temporary files +*.tmp +*.temp +*~ +.#* +#* + +# IDE files +.vscode/ +.idea/ +*.swp +*.swo + +# OS files +.DS_Store +Thumbs.db + +# Git files +.git/ +.gitignore + +# Documentation builds +docs/_build/ +*.pdf + +# Test outputs +test_file.bin +downloaded_*.bin +*.downloaded* + +# Docker files +.dockerignore + +# Logs +*.log + +# Cache directories +.cache/ +__pycache__/ + +# Coverage reports +*.gcov +*.gcda +*.gcno \ No newline at end of file diff --git a/Dockerfile.dropshell-build b/Dockerfile.dropshell-build index 0acfefa..fe58a8d 100644 --- a/Dockerfile.dropshell-build +++ b/Dockerfile.dropshell-build @@ -15,9 +15,17 @@ ENV CCACHE_DIR=/ccache ENV CCACHE_COMPILERCHECK=content ENV CCACHE_MAXSIZE=2G -COPY . . +# Copy only build files first (for better layer caching) +COPY CMakeLists.txt cmake_prebuild.sh ./ +COPY src/version.hpp.in src/ -# Configure and build with ccache using cache mounts +# Run prebuild script early (this rarely changes) +RUN bash cmake_prebuild.sh + +# Copy source files (this invalidates cache when source changes) +COPY src/ src/ + +# Configure project (this step is cached unless CMakeLists.txt changes) RUN --mount=type=cache,target=/ccache \ --mount=type=cache,target=/build \ mkdir -p /build && \ @@ -38,11 +46,12 @@ RUN --mount=type=cache,target=/ccache \ -DOPENSSL_INCLUDE_DIR=/usr/local/include \ ${CMAKE_TOOLCHAIN_FILE:+-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE} -# Build with cache mounts +# Run prebuild script RUN --mount=type=cache,target=/ccache \ --mount=type=cache,target=/build \ cmake --build /build --target run_prebuild_script +# Build project (ccache will help here when only some files change) RUN --mount=type=cache,target=/ccache \ --mount=type=cache,target=/build \ cmake --build /build diff --git a/src/main.cpp b/src/main.cpp index d29342a..574ba39 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -107,7 +107,7 @@ int main(int argc, char* argv[]) { std::cout << dropshell::VERSION << std::endl; return 0; } - std::cout << "simple_object_storage version: " << dropshell::VERSION << std::endl; + std::cout << "Simple Object Storage version: " << dropshell::VERSION << std::endl; } // Set up signal handlers