Sign inSign up

rucer/devenv

By rucer

•Updated about 1 year ago

Development environment - ALL in one

Image
1

1.7K

rucer/devenv repository overview

⁠Development Environment

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⁠.

⁠Run Image

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
⁠Keep Container Running

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.

⁠Daemon Tasks

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:

PriorityGroupTaskPortAutostartComment
101SystemsyslogtrueSystem log service
102SystemdbustrueSystem-wide message bus
103SystemntpfalseSync local time with network
104Systemssh22trueEnable external connections through SSH
105SystemcrontrueExecute tasks in schedule
106SystemftpfalseSecure FTP server
201Servicefail2banfalseBan hosts that cause multiple authentication errors
202Servicefilebrowser4000falseVersatile container FS inspector
203Servicewebhook9000falseUse HTTP requests to trigger commands
301Tooliperf5201falseNetwork bandwidth profiler

⁠Features

The following tables outline several categories, each of them contains a list of well-chosen packages and components.

⁠Base
CategoryNameVersionComment
Basebsdmainutils12.1.8Transitional package for more utilities from FreeBSD
Basecron3.0Process scheduling daemon
Basekmod31Tools for managing Linux kernel modules
Baselibreadline88.2GNU readline and history libraries
Baselocales2.39GNU C Library: National Language (locale) data
Basersyslog8.2312.0Reliable system and kernel logging daemon
Basesudo1.9.15Provide limited super user privileges to specific users
Baseopenssh-server9.6secure shell (SSH) server
⁠System
CategoryNameVersionComment
Systemascii3.18Interactive ASCII name and synonym chart
Systembatcat⁠0.24.0A cat(1) clone with wings
Systembusybox⁠1.36.1The Swiss Army Knife of Embedded Linux
Systemdos2unix7.5.1Convert text file line endings between CRLF and LF
Systemduf⁠0.8.1Disk Usage/Free Utility - a better df alternative
Systemfail2ban⁠1.0.2Daemon to ban hosts that cause multiple authentication errors
Systemfdisk2.39.3Collection of partitioning utilities
Systemgettext0.21GNU Internationalization utilities
SystemGit⁠2.43.0Distributed version control system designed to handle everything from small to very large projects with speed and efficiency
Systemhtop⁠3.3.0Interactive text-mode process viewer
Systemhttpie⁠3.2.2Modern, user-friendly command-line HTTP client for the API era
Systemicdiff⁠2.0.7Improved colored diff
Systemneofetch⁠7.1.0A command-line system information tool
Systemranger⁠1.9.3A VIM-inspired file manager for the console
Systemsupervisor⁠4.2.5Supervisor process control system
Systemtrash-cli⁠0.23.11.10Command line interface to the freedesktop.org trashcan
Systemunicode3.1-1Display unicode character properties
Systemvsftpd⁠3.0.5Probably the most secure and fastest FTP server for UNIX-like systems
Systemwamerican-insane2020.12.07-2American English dictionary words
Systemzsh⁠5.9Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Enhanced by ohmyzsh⁠
⁠Network
CategoryNameVersionComment
Networkdnsutils9.18.3Transitional package for bind9-dnsutils
Networkiftop1.0pre4Displays bandwidth usage information on an network interface
Networkiperf3⁠3.16iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks
Networkiptables1.8.10Administration tools for packet filtering and NAT
Networkntp⁠4.2.8NTP is a protocol designed to synchronize the clocks of computers over a network
Networktelnet0.17Basic telnet client
Networktraceroute2.1.5Traces the route taken by packets over an IPv4/IPv6 network
Networkufw⁠0.36.2Program for managing a Netfilter firewall
Networkwhois5.5.22Intelligent WHOIS client
⁠Runtimes
CategoryNameVersionRuntime ManagerRuntime Manager Version
RuntimeC/C++13.3.0
RuntimePython3.12.6uv0.8.13
Runtime.NET8.0.119
RuntimeElixir1.17.3
RuntimeErlang27
RuntimeGo1.24.6
RuntimeJava21
RuntimeLisp2.2.9
RuntimeLua5.4.1
RuntimeNode22.18.0fnm1.38.1
RuntimePerl5.38.2
RuntimePHP8.3.6-FPM
RuntimeRuby3.2.3
RuntimeRust1.89.0
⁠Tools
CategoryNameVersionComment
Toolapache2-utils2.4.52Apache HTTP Server (utility programs for web servers)
Toolasciinema⁠2.4.0Terminal session recorder
Toolbc1.07.1Command line calculator
Toolbazel⁠8.3.1A fast, scalable, multi-language and extensible build system
Toolbottom⁠, btop0.11.1Yet another cross-platform graphical process/system monitor
Toolcheat⁠4.4.2Allows you to create and view interactive cheatsheets on the command-line
Toolcloc⁠1.98Source code lines counter
Toolexiftool⁠13.34Reading, write and edit meta information in a wide variety of files
Toolffmpeg⁠7.1A complete, cross-platform solution to record, convert and stream audio and video
Toolfilebrowser⁠2.42.5Web File Browser, versatile container FS inspector
Toolfocus-Create a foreground process that aligns with a background process
Toolgencert-Generate self-signed X.509 certificates
Toolgenpass-Generate random strong passwords
ToolGradle⁠8.14.3Adaptable, fast automation for all
Toolinspect-Self-check the components of current container
ToolJMeter⁠5.6.3A 100% pure Java application designed to load test functional behavior and measure performance
Tooljq⁠1.7Command-line JSON processor
Tooljsonnet⁠0.20.0The data templating language
Toollstime-List times of important timezones in a table
Toollux⁠0.24.1Fast and simple video download library and CLI tool
Toolmirror-Change the apt/npm/pip repository to Chinese mainland version
Toolmysql-client⁠8.0.43MySQL database client
Toolpostgresql-client⁠16.9Postgres SQL database client
Toolprotoc⁠32.0Protocol Buffers compiler
Toolrsync⁠3.2.7Utility that provides fast incremental file transfer
Toolsqlite3⁠3.45.1SQLite database client
Toolssh-key-Generate a SSH key stored in /root/.ssh-auto
Toolthefuck⁠3.32Magnificent app which corrects your previous console command
Toolvim9.1.697Vim enhanced by vimrc⁠
Toolwebhook⁠2.8.0A lightweight incoming webhook server to run shell commands
Toolwrk⁠4.1.0Modern HTTP benchmarking tool
Toolyq⁠4.47.1yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
⁠Fun
CategoryNameVersionComment
Funcmatrix⁠2.0-6Terminal based "The Matrix" like implementation
Funcowsay3.03Takes the text input and prints it out in a ASCII art speech bubble that is being said by an ASCII art cow
Funfiglet⁠2.2.5Making large letters out of ordinary text
Funfortune⁠1.99.1Print a random, hopefully interesting, adage
Funlolcat⁠100.0.1Rainbows and unicorns!
Funpv⁠1.8.5Monitor the progress of data through a pipe
Funrig⁠1.11Random identity generator
Funsl⁠5.02Cure your bad habit of mistyping
Funtree⁠2.1.1List contents of directories in a tree-like format

⁠Notes

⁠Build Image Through GitHub Action

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
⁠Git Configuration

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
⁠Use SSH Tunnel

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]
⁠Syslog

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.

⁠Snapd

It's a pity that the snapd⁠ can't(or hardly can) be installed inside a docker image.

⁠WSL Resource Quota

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
⁠Windows Volume Mount

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.

Tag summary

Content type

Image

Digest

sha256:0a03798ff…

Size

2 GB

Last updated

about 1 year ago

docker pull rucer/devenv