mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-23 21:04:14 +03:00
fix images & add runtime image version
This commit is contained in:
parent
5061ea860e
commit
088ce6c4d8
@ -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/*
|
||||
|
||||
|
@ -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 \
|
||||
|
@ -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"]
|
||||
|
@ -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(())
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user