Package all commonly used runtimes and tools in a single container, and run as a main entrypoint of development. You can find the built image in DockerHub.
It's recommended to use this image with VS Code Remote.
docker volume create devenv-code
docker volume create devenv-share
docker run -d \
--name devenv \
--hostname devenv \
--restart unless-stopped \
--init \
-p 2026:22 \
-v devenv-code:/root/code \
-v devenv-share:/root/share \
rucer/devenv
The container will start a foreground sleep infinity process as default command, so you needn't to do anything to keep the container running. The container will automatically start an OpenSSH server, to connect the container externally, you should create password for root user by the following commands:
# To set password silently in a single line
$ usermod --password $(echo ${PASSWORD} | openssl passwd -1 -stdin) root
# Or set password interactively
$ passwd
It's recommended to add the --init flag while running the container, since the container is designed to run continuously with multiple services, --init will assign a tiny init process to reap zombie processes.
The container will create several background tasks through the supervisord by default, the detailed tasks could be found under /etc/supervisor/conf.d directory. All the tasks are briefly listed as follows:
| Priority | Group | Task | Port | Autostart | Comment |
|---|---|---|---|---|---|
| 101 | System | syslog | true | System log service | |
| 102 | System | dbus | true | System-wide message bus | |
| 103 | System | ntp | false | Sync local time with network | |
| 104 | System | ssh | 22 | true | Enable external connections through SSH |
| 105 | System | cron | true | Execute tasks in schedule | |
| 106 | System | ftp | false | Secure FTP server | |
| 201 | Service | fail2ban | false | Ban hosts that cause multiple authentication errors | |
| 202 | Service | filebrowser | 4000 | false | Versatile container FS inspector |
| 203 | Service | webhook | 9000 | false | Use HTTP requests to trigger commands |
| 301 | Tool | iperf | 5201 | false | Network bandwidth profiler |
The following tables outline several categories, each of them contains a list of well-chosen packages and components.
| Category | Name | Version | Comment |
|---|---|---|---|
| Base | bsdmainutils | 12.1.8 | Transitional package for more utilities from FreeBSD |
| Base | cron | 3.0 | Process scheduling daemon |
| Base | kmod | 31 | Tools for managing Linux kernel modules |
| Base | libreadline8 | 8.2 | GNU readline and history libraries |
| Base | locales | 2.39 | GNU C Library: National Language (locale) data |
| Base | rsyslog | 8.2312.0 | Reliable system and kernel logging daemon |
| Base | sudo | 1.9.15 | Provide limited super user privileges to specific users |
| Base | openssh-server | 9.6 | secure shell (SSH) server |
| Category | Name | Version | Comment |
|---|---|---|---|
| System | ascii | 3.18 | Interactive ASCII name and synonym chart |
| System | batcat | 0.24.0 | A cat(1) clone with wings |
| System | busybox | 1.36.1 | The Swiss Army Knife of Embedded Linux |
| System | dos2unix | 7.5.1 | Convert text file line endings between CRLF and LF |
| System | duf | 0.8.1 | Disk Usage/Free Utility - a better df alternative |
| System | fail2ban | 1.0.2 | Daemon to ban hosts that cause multiple authentication errors |
| System | fdisk | 2.39.3 | Collection of partitioning utilities |
| System | gettext | 0.21 | GNU Internationalization utilities |
| System | Git | 2.43.0 | Distributed version control system designed to handle everything from small to very large projects with speed and efficiency |
| System | htop | 3.3.0 | Interactive text-mode process viewer |
| System | httpie | 3.2.2 | Modern, user-friendly command-line HTTP client for the API era |
| System | icdiff | 2.0.7 | Improved colored diff |
| System | neofetch | 7.1.0 | A command-line system information tool |
| System | ranger | 1.9.3 | A VIM-inspired file manager for the console |
| System | supervisor | 4.2.5 | Supervisor process control system |
| System | trash-cli | 0.23.11.10 | Command line interface to the freedesktop.org trashcan |
| System | unicode | 3.1-1 | Display unicode character properties |
| System | vsftpd | 3.0.5 | Probably the most secure and fastest FTP server for UNIX-like systems |
| System | wamerican-insane | 2020.12.07-2 | American English dictionary words |
| System | zsh | 5.9 | Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Enhanced by ohmyzsh |
| Category | Name | Version | Comment |
|---|---|---|---|
| Network | dnsutils | 9.18.3 | Transitional package for bind9-dnsutils |
| Network | iftop | 1.0pre4 | Displays bandwidth usage information on an network interface |
| Network | iperf3 | 3.16 | iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks |
| Network | iptables | 1.8.10 | Administration tools for packet filtering and NAT |
| Network | ntp | 4.2.8 | NTP is a protocol designed to synchronize the clocks of computers over a network |
| Network | telnet | 0.17 | Basic telnet client |
| Network | traceroute | 2.1.5 | Traces the route taken by packets over an IPv4/IPv6 network |
| Network | ufw | 0.36.2 | Program for managing a Netfilter firewall |
| Network | whois | 5.5.22 | Intelligent WHOIS client |
| Category | Name | Version | Runtime Manager | Runtime Manager Version |
|---|---|---|---|---|
| Runtime | C/C++ | 13.3.0 | ||
| Runtime | Python | 3.12.6 | uv | 0.8.13 |
| Runtime | .NET | 8.0.119 | ||
| Runtime | Elixir | 1.17.3 | ||
| Runtime | Erlang | 27 | ||
| Runtime | Go | 1.24.6 | ||
| Runtime | Java | 21 | ||
| Runtime | Lisp | 2.2.9 | ||
| Runtime | Lua | 5.4.1 | ||
| Runtime | Node | 22.18.0 | fnm | 1.38.1 |
| Runtime | Perl | 5.38.2 | ||
| Runtime | PHP | 8.3.6-FPM | ||
| Runtime | Ruby | 3.2.3 | ||
| Runtime | Rust | 1.89.0 |
| Category | Name | Version | Comment |
|---|---|---|---|
| Tool | apache2-utils | 2.4.52 | Apache HTTP Server (utility programs for web servers) |
| Tool | asciinema | 2.4.0 | Terminal session recorder |
| Tool | bc | 1.07.1 | Command line calculator |
| Tool | bazel | 8.3.1 | A fast, scalable, multi-language and extensible build system |
| Tool | bottom, btop | 0.11.1 | Yet another cross-platform graphical process/system monitor |
| Tool | cheat | 4.4.2 | Allows you to create and view interactive cheatsheets on the command-line |
| Tool | cloc | 1.98 | Source code lines counter |
| Tool | exiftool | 13.34 | Reading, write and edit meta information in a wide variety of files |
| Tool | ffmpeg | 7.1 | A complete, cross-platform solution to record, convert and stream audio and video |
| Tool | filebrowser | 2.42.5 | Web File Browser, versatile container FS inspector |
| Tool | focus | - | Create a foreground process that aligns with a background process |
| Tool | gencert | - | Generate self-signed X.509 certificates |
| Tool | genpass | - | Generate random strong passwords |
| Tool | Gradle | 8.14.3 | Adaptable, fast automation for all |
| Tool | inspect | - | Self-check the components of current container |
| Tool | JMeter | 5.6.3 | A 100% pure Java application designed to load test functional behavior and measure performance |
| Tool | jq | 1.7 | Command-line JSON processor |
| Tool | jsonnet | 0.20.0 | The data templating language |
| Tool | lstime | - | List times of important timezones in a table |
| Tool | lux | 0.24.1 | Fast and simple video download library and CLI tool |
| Tool | mirror | - | Change the apt/npm/pip repository to Chinese mainland version |
| Tool | mysql-client | 8.0.43 | MySQL database client |
| Tool | postgresql-client | 16.9 | Postgres SQL database client |
| Tool | protoc | 32.0 | Protocol Buffers compiler |
| Tool | rsync | 3.2.7 | Utility that provides fast incremental file transfer |
| Tool | sqlite3 | 3.45.1 | SQLite database client |
| Tool | ssh-key | - | Generate a SSH key stored in /root/.ssh-auto |
| Tool | thefuck | 3.32 | Magnificent app which corrects your previous console command |
| Tool | vim | 9.1.697 | Vim enhanced by vimrc |
| Tool | webhook | 2.8.0 | A lightweight incoming webhook server to run shell commands |
| Tool | wrk | 4.1.0 | Modern HTTP benchmarking tool |
| Tool | yq | 4.47.1 | yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor |
| Category | Name | Version | Comment |
|---|---|---|---|
| Fun | cmatrix | 2.0-6 | Terminal based "The Matrix" like implementation |
| Fun | cowsay | 3.03 | Takes the text input and prints it out in a ASCII art speech bubble that is being said by an ASCII art cow |
| Fun | figlet | 2.2.5 | Making large letters out of ordinary text |
| Fun | fortune | 1.99.1 | Print a random, hopefully interesting, adage |
| Fun | lolcat | 100.0.1 | Rainbows and unicorns! |
| Fun | pv | 1.8.5 | Monitor the progress of data through a pipe |
| Fun | rig | 1.11 | Random identity generator |
| Fun | sl | 5.02 | Cure your bad habit of mistyping |
| Fun | tree | 2.1.1 | List contents of directories in a tree-like format |
Shall error occurs in COPY/ADD instruction while building docker images in GitHub actions, use the following command to modify the Dockerfile before building as a workaround:
$ sed -i -E "s/COPY --from(.*)/RUN true\nCOPY --from\1/" deploy/Dockerfile
There are some built-in Git configurations inside the image, you can override them by executing the following commands or by editing ${HOME}/.gitconfig directly.
$ git config --global user.name "${YOUR_NAME_HERE}"
$ git config --global user.email "${YOU_EMAIL_HERE}"
$ git config --global --unset branch.master.pushRemote
If you want to expose your services inside container to host machine without publishing extra ports through docker, SSH tunneling is your best option. Say you want to expose the Express server(which runs on port 3000) inside container to host(by port 8000), you can execute the following command in your host machine:
$ ssh -L 8000:127.0.0.1:3000 -p ${SSH_PORT} [email protected]
Since the whole image is a minimized Ubuntu OS, some important components are not installed within it naturally, in which rsyslog is one of the most important things. Many system services rely on rsyslog to create the log messages, such as sshd. The /var/log/auth.log won't be created without rsyslog, then you can't use fail2ban because of the lacking of log files neither. You can find a detailed explanation here.
The image will install the rsyslog package and register rsyslogd as a supervisor service. You can use the functionalities of rsyslog without doing anything additionally, but you should be aware of the background rsyslog service.
It's a pity that the snapd can't(or hardly can) be installed inside a docker image.
When you are using this container on Windows platform, the best practice is to set resource quota of WSL. You can reference the WSL configuration example to set it. Here is the simplified WSL configuration dedicated for resource quota.
[wsl2]
processors = 4
memory = 16GB
swap = 8GB
Interop between Docker container and direct Windows file systems could be extremely slow because of WSL's nature. So it's recommended to not directly mount volumes from Windows platform to the container. You can create named volume or mount files from inside WSL systems like WSL for Ubuntu to solve this problem.
Content type
Image
Digest
sha256:0a03798ff…
Size
2 GB
Last updated
about 1 year ago
docker pull rucer/devenv