-
Notifications
You must be signed in to change notification settings - Fork 248
feat: add Docker support #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sun-ZhenXing
wants to merge
8
commits into
superradcompany:main
Choose a base branch
from
Sun-ZhenXing:feat-docker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+156
−3
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a37bc3f
feat: add Docker support
Sun-ZhenXing 0f28cfd
Merge branch 'main' into feat-docker
Sun-ZhenXing 3208149
Create README.md for Docker setup documentation
Sun-ZhenXing 098cd31
Merge branch 'zerocore-ai:main' into feat-docker
Sun-ZhenXing 7210dc8
feat(docker): restructure Docker setup and update installation script
Sun-ZhenXing 0f490bd
Update docker/docker-compose.yaml
Sun-ZhenXing 74f06cf
Update docker/docker-compose.yaml
Sun-ZhenXing 7dc553f
Update docker/docker-compose.yaml
Sun-ZhenXing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| ARG DEBIAN_VERSION=13.2-slim | ||
| FROM debian:${DEBIAN_VERSION} | ||
|
|
||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| ARG MICROSANDBOX_VERSION=0.2.6 | ||
| ARG TARGETARCH | ||
|
|
||
| RUN apt update && \ | ||
| apt install -y --no-install-recommends \ | ||
| ca-certificates \ | ||
| curl && \ | ||
| apt clean && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Download and install microsandbox binary based on architecture | ||
| RUN ARCH=${TARGETARCH:-amd64} && \ | ||
| case "${ARCH}" in \ | ||
| amd64) MICROSANDBOX_ARCH="x86_64" ;; \ | ||
| arm64) MICROSANDBOX_ARCH="aarch64" ;; \ | ||
| *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ | ||
| esac && \ | ||
| curl -fsSL "https://github.com/zerocore-ai/microsandbox/releases/download/microsandbox-v${MICROSANDBOX_VERSION}/microsandbox-${MICROSANDBOX_VERSION}-linux-${MICROSANDBOX_ARCH}.tar.gz" \ | ||
Sun-ZhenXing marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| -o /tmp/microsandbox.tar.gz && \ | ||
| mkdir -p /usr/local/bin /usr/local/lib && \ | ||
| tar -xzf /tmp/microsandbox.tar.gz -C /tmp && \ | ||
| cd /tmp/microsandbox-${MICROSANDBOX_VERSION}-linux-${MICROSANDBOX_ARCH} && \ | ||
| mv ms* /usr/local/bin/ && \ | ||
| mv *.so.* /usr/local/lib/ && \ | ||
| chmod +x /usr/local/bin/ms* && \ | ||
Sun-ZhenXing marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Sun-ZhenXing marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| rm -rf /tmp/microsandbox* | ||
|
|
||
| # Setup directories for root user | ||
| RUN mkdir -p /root/.local/bin /root/.local/lib /root/.microsandbox | ||
|
|
||
| # Set up environment variables (based on setup_env.sh) | ||
| ENV PATH="/root/.local/bin:/usr/local/bin:${PATH}" | ||
| ENV LD_LIBRARY_PATH="/root/.local/lib:/usr/local/lib:${LD_LIBRARY_PATH}" | ||
| ENV HOME="/root" | ||
|
|
||
| WORKDIR /root | ||
|
|
||
| ARG MICROSANDBOX_AUTO_PULL_IMAGES=true | ||
| RUN if [ "${MICROSANDBOX_AUTO_PULL_IMAGES}" = "true" ]; then \ | ||
| msb pull microsandbox/python && \ | ||
| msb pull microsandbox/node; \ | ||
| fi | ||
|
|
||
| VOLUME [ "/root/.microsandbox/namespaces" ] | ||
|
|
||
| # Default to microsandbox CLI | ||
| ENTRYPOINT ["/usr/local/bin/msb"] | ||
| CMD ["server", "start", "--host", "0.0.0.0", "--port", "5555"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| services: | ||
| microsandbox: | ||
| image: alexsuntop/microsandbox:${MICROSANDBOX_VERSION:-0.2.6} | ||
Sun-ZhenXing marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| args: | ||
| - DEBIAN_VERSION=${DEBIAN_VERSION:-13.2-slim} | ||
| - MICROSANDBOX_VERSION=${MICROSANDBOX_VERSION:-0.2.6} | ||
| - MICROSANDBOX_AUTO_PULL_IMAGES=${MICROSANDBOX_AUTO_PULL_IMAGES:-true} | ||
| restart: unless-stopped | ||
| ports: | ||
| - ${MICROSANDBOX_PORT_OVERRIDE:-5555}:${MICROSANDBOX_PORT:-5555} | ||
| privileged: true | ||
| security_opt: | ||
| - apparmor=unconfined | ||
| - seccomp=unconfined | ||
| environment: | ||
| - TZ=${TZ:-UTC} | ||
| - MICROSANDBOX_HOME=/root/.microsandbox | ||
| volumes: | ||
| - microsandbox_config:/root/.microsandbox/namespaces | ||
| - microsandbox_workspace:/workspace | ||
| devices: | ||
| - /dev/kvm:/dev/kvm | ||
| - /dev/net/tun:/dev/net/tun | ||
| command: | ||
| [ | ||
| "server", | ||
| "start", | ||
| "--host", | ||
| "0.0.0.0", | ||
| "--port", | ||
| "${MICROSANDBOX_PORT:-5555}", | ||
| "--dev", | ||
| ] | ||
| working_dir: /workspace | ||
| deploy: | ||
| resources: | ||
| limits: | ||
| cpus: ${MICROSANDBOX_CPU_LIMIT:-4.00} | ||
| memory: ${MICROSANDBOX_MEMORY_LIMIT:-8G} | ||
| reservations: | ||
| cpus: ${MICROSANDBOX_CPU_RESERVATION:-1.00} | ||
| memory: ${MICROSANDBOX_MEMORY_RESERVATION:-2G} | ||
|
|
||
| volumes: | ||
| microsandbox_config: | ||
| microsandbox_workspace: | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.