|
| 1 | +FROM kasmweb/core-ubuntu-jammy:1.18.0 |
| 2 | +USER root |
| 3 | + |
| 4 | +ENV HOME /home/kasm-default-profile |
| 5 | +ENV STARTUPDIR /dockerstartup |
| 6 | +ENV INST_SCRIPTS $STARTUPDIR/install |
| 7 | +WORKDIR $HOME |
| 8 | + |
| 9 | +######### Customize Container Here ########### |
| 10 | + |
| 11 | +RUN apt-get update && apt-get install -y \ |
| 12 | + git \ |
| 13 | + curl \ |
| 14 | + lsof \ |
| 15 | + ripgrep \ |
| 16 | + ca-certificates \ |
| 17 | + grep \ |
| 18 | + gawk \ |
| 19 | + sed \ |
| 20 | + findutils \ |
| 21 | + coreutils \ |
| 22 | + procps \ |
| 23 | + jq \ |
| 24 | + less \ |
| 25 | + tree \ |
| 26 | + file \ |
| 27 | + python3 \ |
| 28 | + python3-pip \ |
| 29 | + python3-venv \ |
| 30 | + chromium-browser \ |
| 31 | + unzip \ |
| 32 | + && rm -rf /var/lib/apt/lists/* |
| 33 | + |
| 34 | +RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ |
| 35 | + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ |
| 36 | + && apt-get update && apt-get install -y gh \ |
| 37 | + && rm -rf /var/lib/apt/lists/* |
| 38 | + |
| 39 | +RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \ |
| 40 | + && apt-get install -y nodejs \ |
| 41 | + && rm -rf /var/lib/apt/lists/* |
| 42 | + |
| 43 | +RUN corepack enable && corepack prepare pnpm@latest --activate |
| 44 | + |
| 45 | +RUN curl -fsSL https://bun.sh/install | bash && \ |
| 46 | + mv $HOME/.bun /opt/bun && \ |
| 47 | + chmod -R 755 /opt/bun && \ |
| 48 | + ln -s /opt/bun/bin/bun /usr/local/bin/bun |
| 49 | + |
| 50 | +ARG UV_VERSION=latest |
| 51 | +ARG OPENCODE_VERSION=latest |
| 52 | + |
| 53 | +RUN curl -LsSf https://astral.sh/uv/install.sh | UV_NO_MODIFY_PATH=1 sh && \ |
| 54 | + mv $HOME/.local/bin/uv /usr/local/bin/uv && \ |
| 55 | + mv $HOME/.local/bin/uvx /usr/local/bin/uvx && \ |
| 56 | + chmod +x /usr/local/bin/uv /usr/local/bin/uvx && \ |
| 57 | + if [ "${OPENCODE_VERSION}" = "latest" ]; then \ |
| 58 | + curl -fsSL https://opencode.ai/install | bash -s -- --no-modify-path; \ |
| 59 | + else \ |
| 60 | + curl -fsSL https://opencode.ai/install | bash -s -- --version ${OPENCODE_VERSION} --no-modify-path; \ |
| 61 | + fi && \ |
| 62 | + mv $HOME/.opencode /opt/opencode && \ |
| 63 | + chmod -R 755 /opt/opencode && \ |
| 64 | + ln -s /opt/opencode/bin/opencode /usr/local/bin/opencode |
| 65 | + |
| 66 | +COPY --from=ghcr.io/chriswritescode-dev/opencode-manager:latest /app /opt/opencode-manager |
| 67 | +COPY --from=ghcr.io/chriswritescode-dev/opencode-manager:latest /opt/opencode-plugins /opt/opencode-plugins |
| 68 | + |
| 69 | +RUN mkdir -p /workspace /opt/opencode-manager/data && \ |
| 70 | + chown -R 1000:0 /workspace /opt/opencode-manager/data /opt/opencode-plugins |
| 71 | + |
| 72 | +ENV NODE_ENV=production |
| 73 | +ENV HOST=0.0.0.0 |
| 74 | +ENV PORT=5003 |
| 75 | +ENV OPENCODE_SERVER_PORT=5551 |
| 76 | +ENV DATABASE_PATH=/opt/opencode-manager/data/opencode.db |
| 77 | +ENV WORKSPACE_PATH=/workspace |
| 78 | +ENV NODE_PATH=/opt/opencode-plugins/node_modules |
| 79 | + |
| 80 | +COPY scripts/kasm-startup.sh $STARTUPDIR/custom_startup.sh |
| 81 | +RUN chmod +x $STARTUPDIR/custom_startup.sh |
| 82 | + |
| 83 | +######### End Customizations ########### |
| 84 | + |
| 85 | +RUN chown 1000:0 $HOME |
| 86 | +RUN $STARTUPDIR/set_user_permission.sh $HOME |
| 87 | + |
| 88 | +ENV HOME /home/kasm-user |
| 89 | +WORKDIR $HOME |
| 90 | +RUN mkdir -p $HOME && chown -R 1000:0 $HOME |
| 91 | + |
| 92 | +USER 1000 |
0 commit comments