Merge pull request #23 from glide-the/fix-sanbox
Refactor Dockerfile entrypoint and update README instructions
This commit is contained in:
commit
5e3e230eed
15
Dockerfile
15
Dockerfile
@ -51,20 +51,7 @@ WORKDIR /workspace
|
|||||||
RUN cat << 'EOF' > /entrypoint.sh
|
RUN cat << 'EOF' > /entrypoint.sh
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Generate random workspace directory name with timestamp and random suffix
|
/root/.bun/bin/bun /app/cli.js -c /workspace "$@"
|
||||||
WORKSPACE_DIR="/workspace_$(date +%s)_$(head /dev/urandom | tr -dc a-z0-9 | head -c 8)"
|
|
||||||
|
|
||||||
# Create the workspace directory
|
|
||||||
mkdir -p "$WORKSPACE_DIR"
|
|
||||||
|
|
||||||
# Mount bind the random workspace to the default /workspace directory
|
|
||||||
mount --bind "$WORKSPACE_DIR" /workspace
|
|
||||||
|
|
||||||
|
|
||||||
# Change to the workspace directory
|
|
||||||
cd "$WORKSPACE_DIR" || exit 1
|
|
||||||
|
|
||||||
/root/.bun/bin/bun /app/cli.js "$@"
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|||||||
@ -61,7 +61,7 @@ git clone https://github.com/shareAI-lab/Kode.git
|
|||||||
cd Kode
|
cd Kode
|
||||||
|
|
||||||
# Build the image locally
|
# Build the image locally
|
||||||
docker build -t Kode .
|
docker build --no-cache -t Kode .
|
||||||
|
|
||||||
# Run in your project directory
|
# Run in your project directory
|
||||||
cd your-project
|
cd your-project
|
||||||
|
|||||||
@ -58,7 +58,7 @@ git clone https://github.com/shareAI-lab/Kode.git
|
|||||||
cd Kode
|
cd Kode
|
||||||
|
|
||||||
# 本地构建镜像
|
# 本地构建镜像
|
||||||
docker build -t Kode .
|
docker build --no-cache -t Kode .
|
||||||
|
|
||||||
# 在你的项目目录中运行
|
# 在你的项目目录中运行
|
||||||
cd your-project
|
cd your-project
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user