diff --git a/libs/kasm/Dockerfile b/libs/kasm/Dockerfile new file mode 100644 index 00000000..c3a4c795 --- /dev/null +++ b/libs/kasm/Dockerfile @@ -0,0 +1,37 @@ +FROM kasmweb/core-ubuntu-jammy:1.17.0 +USER root + +ENV HOME=/home/kasm-default-profile +ENV STARTUPDIR=/dockerstartup +ENV INST_SCRIPTS=$STARTUPDIR/install +WORKDIR $HOME + +######### Customize Container Here ########### + +# Installing python, pip, and libraries +RUN apt-get update +RUN apt install -y wget build-essential libncursesw5-dev libssl-dev \ +libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev +RUN add-apt-repository ppa:deadsnakes/ppa +RUN apt install -y python3.11 python3-pip python3-tk python3-dev \ +gnome-screenshot wmctrl ffmpeg socat xclip + +RUN pip install cua-computer-server + +# Disable SSL requirement +RUN sed -i 's/require_ssl: true/require_ssl: false/g' /usr/share/kasmvnc/kasmvnc_defaults.yaml +RUN sed -i 's/-sslOnly//g' /dockerstartup/vnc_startup.sh + +# Running the python script on startup +RUN echo "/usr/bin/python3 -m computer_server" > $STARTUPDIR/custom_startup.sh \ +&& chmod +x $STARTUPDIR/custom_startup.sh + +######### End Customizations ########### + +RUN chown 1000:0 $HOME +RUN $STARTUPDIR/set_user_permission.sh $HOME +ENV HOME=/home/kasm-user +WORKDIR $HOME +RUN mkdir -p $HOME && chown -R 1000:0 $HOME + +USER 1000 \ No newline at end of file diff --git a/libs/kasm/README.md b/libs/kasm/README.md new file mode 100644 index 00000000..773c81de --- /dev/null +++ b/libs/kasm/README.md @@ -0,0 +1,31 @@ +# Kasm Cua Container + +Containerized virtual desktop for Computer-Using Agents (CUA). + +## Usage + +Building the container: + +```bash +docker build -t kasm-cua . +``` + +Running the container: +```bash +docker run --rm -it --shm-size=512m -p 6901:6901 -p 8000:8000 -e VNC_PW=password kasm-cua +``` +A VNC client will be available at `localhost:6901` with the username `kasm-user` and password `password`. + +The container will run a Computer Server instance in the background. You can access the Computer Server API at `http://localhost:8000` or using the cua Computer SDK. + +## Creating a snapshot + +You can create a snapshot of the container at any time by running: +```bash +docker commit kasm-cua-snapshot +``` + +You can then run the snapshot by running: +```bash +docker run --rm -it --shm-size=512m -p 6901:6901 -p 8000:8000 -e VNC_PW=password kasm-cua-snapshot +```