diff --git a/Dockerfile.buildbase b/Dockerfile.buildbase index 40936760..fac21651 100644 --- a/Dockerfile.buildbase +++ b/Dockerfile.buildbase @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libclang-dev \ clang \ curl \ + git \ + python3 \ && update-ca-certificates \ && rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile.buildpackage b/Dockerfile.buildpackage index 12eccc04..7504bb47 100644 --- a/Dockerfile.buildpackage +++ b/Dockerfile.buildpackage @@ -3,12 +3,6 @@ FROM nick1udwig/buildbase:latest ENV NVM_DIR=/root/.nvm \ PATH="/root/.nvm/versions/node/$(node -v)/bin:${PATH}" -# Install Git -RUN apt-get update && apt-get install -y --no-install-recommends \ - git \ - python3 \ - && rm -rf /var/lib/apt/lists/* - RUN . ~/.bashrc \ && . ~/.cargo/env \ && . $NVM_DIR/nvm.sh \ diff --git a/Dockerfile.buildruntime b/Dockerfile.buildruntime index 6b5bf791..3b4bdd31 100644 --- a/Dockerfile.buildruntime +++ b/Dockerfile.buildruntime @@ -1,16 +1,14 @@ FROM nick1udwig/buildbase:latest -ENV NVM_DIR=/root/.nvm \ - PATH="/root/.nvm/versions/node/$(node -v)/bin:${PATH}" +ARG DOCKER_BUILD_IMAGE_VERSION=latest -RUN apt-get update && apt-get install -y --no-install-recommends \ - git \ - python3 \ - && rm -rf /var/lib/apt/lists/* +ENV NVM_DIR=/root/.nvm \ + PATH="/root/.nvm/versions/node/$(node -v)/bin:${PATH}" \ + DOCKER_BUILD_IMAGE_VERSION=$DOCKER_BUILD_IMAGE_VERSION # Bind readonly & copy files in to avoid modifying host files WORKDIR /input # Set the default command to run the build script # TODO: once build is idempotent, remove the `rm -rf` line -CMD ["/bin/bash", "-c", ". ~/.bashrc && . ~/.cargo/env && . $NVM_DIR/nvm.sh && rm -rf target/ kinode/packages/*/pkg/*wasm kinode/packages/*/*/target/ kinode/packages/*/pkg/api.zip kinode/packages/*/*/wit && ./scripts/build-release.py && cp -r /tmp/kinode-release/* /output && chmod 664 /output/* && rm -rf target/ kinode/packages/*/pkg/*wasm kinode/packages/*/*/target/ kinode/packages/*/pkg/api.zip kinode/packages/*/*/wit"] +CMD ["/bin/bash", "-c", ". ~/.bashrc && . ~/.cargo/env && . $NVM_DIR/nvm.sh && rm -rf target/ kinode/packages/*/pkg/*wasm kinode/packages/*/*/target/ kinode/packages/*/pkg/api.zip kinode/packages/*/*/wit kinode/packages/app_store/pkg/ui kinode/packages/homepage/pkg/ui kinode/src/register-ui/build && ./scripts/build-release.py && cp -r /tmp/kinode-release/* /output && chmod 664 /output/* && rm -rf target/ kinode/packages/*/pkg/*wasm kinode/packages/*/*/target/ kinode/packages/*/pkg/api.zip kinode/packages/*/*/wit kinode/packages/app_store/pkg/ui kinode/packages/homepage/pkg/ui kinode/src/register-ui/build"] diff --git a/kinode/build.rs b/kinode/build.rs index 826a9990..ca9c4184 100644 --- a/kinode/build.rs +++ b/kinode/build.rs @@ -222,5 +222,13 @@ fn main() -> anyhow::Result<()> { let bootstrapped_processes_path = target_dir.join("bootstrapped_processes.rs"); fs::write(&bootstrapped_processes_path, bootstrapped_processes)?; + let version = if let Ok(version) = std::env::var("DOCKER_BUILD_IMAGE_VERSION") { + // embed the DOCKER_BUILD_IMAGE_VERSION + version + } else { + "none".to_string() + }; + println!("cargo:rustc-env=DOCKER_BUILD_IMAGE_VERSION={version}"); + Ok(()) } diff --git a/kinode/src/main.rs b/kinode/src/main.rs index 61619479..6aef8f8c 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -60,6 +60,7 @@ pub const MULTICALL_ADDRESS: &str = "0xcA11bde05977b3631167028862bE2a173976CA11" #[tokio::main] async fn main() { + println!("\nDOCKER_BUILD_IMAGE_VERSION: {}\n", env!("DOCKER_BUILD_IMAGE_VERSION")); let app = build_command(); let matches = app.get_matches(); diff --git a/scripts/build-release.py b/scripts/build-release.py index 06c14b8b..4fd9fa09 100755 --- a/scripts/build-release.py +++ b/scripts/build-release.py @@ -42,7 +42,7 @@ def build_and_move(feature, tmp_dir, architecture, os_name): source_path = f"target/release/{binary_name}" dest_path = os.path.join(tmp_dir, binary_name) shutil.move(source_path, dest_path) - os.chmod(dest_path, 0o664) + os.chmod(dest_path, 0o775) # Create a zip archive of the binary zip_path = os.path.join(tmp_dir, zip_name)