Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🖥 Remote desktop in a container

License

NotificationsYou must be signed in to change notification settings

dmotte/desktainer

Repository files navigation

icon

GitHub main workflowDocker Pulls

💻 Remotedesktop in a container.

📦 This image is also onDocker Hub asdmotte/desktainer and runs onseveral architectures (e.g. amd64, arm64, ...). To see the full list of supported platforms, please refer to the.github/workflows/main.yml file. If you need an architecture which is currently unsupported, feel free to open an issue.

Thanks tofcwu/docker-ubuntu-vnc-desktop andsoffchen/tiny-remote-desktop for the inspiration.

Simple usage

The simplest way to try this image is:

docker run -it --rm -p6901:6901 dmotte/desktainer

Note: since some GUI applications may have issues with Docker's defaultseccomp profile, you may need to use--security-opt seccomp=unconfined

Then head over tohttp://localhost:6901/ to access the remote desktop.

Screenshot

Standard usage

Thedocker-compose.yml file contains a complete usage example for this image. Feel free to simplify it and adapt it to your needs. Unless you want to build the image from scratch, comment out thebuild: build line to use the pre-built one fromDocker Hub instead.

To start the Docker-Compose stack in daemon (detached) mode:

docker-compose up -d

Then you can view the logs using this command:

docker-compose logs -ft

Tips

  • 💡 If you want tochange the resolution while the container is running, you can use thexrandr --fb 1024x768 command. The new resolution cannot be larger than the one specified in theRESOLUTION environment variable though
  • 💡 If you need to, you can extend this project by making your ownDockerfile starting from this image (i.e.FROM dmotte/desktainer) and/or mount customsupervisor configuration files. See theexample folder for an example of how to do it
  • 💡 This image is not meant to be run with the--user Docker option, because thestartup.sh script needs to run as root in the initial phase. Moreover, the user created via theMAINUSER_NAME environment variable (see below) will be asudoer, so running the container as root is useful in any case. If you want arootless version of this image, check outdmotte/desktainer-rootless

Running commands at container startup

If you need to run commands at container startup, you can create Bash scripts in the following locations:

  • /opt/startup-early/*.sh: these scripts will be included in alphabetical orderbefore the main container initialization process
  • /opt/startup-late/*.sh: these scripts will be included in alphabetical orderafter the main container initialization process

See thestartup.sh script for more details.

Moreover, if you need to run commands after the LXDE startup, you can create launcher files in the/etc/xdg/autostart or the~/.config/autostart directory.

Environment variables

List of supportedenvironment variables:

VariableRequiredDescription
RESOLUTIONNo (default: 1920x1080)Screen resolution
MAINUSER_NAMENo (default: mainuser)Name of the main user. If set toroot, no user will be created and the main user will be root
MAINUSER_PASSNo (default:mainuser)Password of the main user (ifMAINUSER_NAME != root)
MAINUSER_NOPASSWORDNo (default:false)Whether or not the main user should be allowed tosudo without password
VNC_PASSNo (default: none)Password for the VNC server
VNC_PORTNo (default: 5901)TCP port of the VNC server
NOVNC_PORTNo (default: 6901)TCP port of the noVNC webserver

Development

If you want to contribute to this project, you can use the following one-liner torebuild the image and bring up theDocker-Compose stack every time you make a change to the code:

docker-compose down&& docker-compose up --build

Note: I know that this Docker image has manylayers, but this shouldn't be a problem in most cases. If you want to reduce its number of layers, there are several techniques out there, e.g. seethis


[8]ページ先頭

©2009-2025 Movatter.jp