Use Docker as a Portable Runtime for One-Shot Commands
Run jq, BusyBox, and Python as one-shot containers, pipe data through them, and bind-mount host files without installing anything locally.

Lab overview
Most developers install dozens of CLIs, interpreters, and one-off utilities on their machines over time - jq for JSON, a specific Python version for one script, BusyBox tools to probe a network, a Node binary just to run a build. Each of these adds drift, version conflicts, and "works on my machine" debt. Docker offers a cleaner alternative: treat every container image as a portable, throwaway runtime. Need jq? Run a jq container. Need Python 3.12 for a single script? Run python:3-slim for ten seconds and let it disappear. The host stays minimal; the tooling stays per-task and nothing accumulates.
This mental shift from "containers are how I deploy services" to "containers are how I run commands" is what unlocks Docker's everyday productivity value, especially for engineers who already use docker run daily for servers but never thought to use it for shell utilities. The --rm flag, stdin/stdout piping, and bind mounts (-v $PWD:/work) together make docker run a drop-in replacement for apt install or brew install whenever you need a tool just once. In this lab, you will use four prebuilt images - Alpine, BusyBox, jq, and Python - as one-shot CLIs, pipe data through them, mount host files into them, and confirm that nothing lingers on your machine when each command finishes.
Objectives
Upon completion of this beginner level lab, you will be able to:
- Run a one-shot container with
--rmand verify nothing persists indocker ps -aafter exit. - Invoke a network utility from a BusyBox container as if it were a locally installed CLI.
- Bind-mount the host working directory into a container so it can read and write project files.
- Pipe host stdin through a jq container and treat it as a portable JSON command-line processor.
- Run a Python script via
python:3-slimwithout installing Python or any package on the host VM.
Who is this lab for?
This lab is designed for:
- Developers who already know
docker pullanddocker runand want to use Docker as an everyday command-line utility. - Platform engineers who want a clean dev box and reach for containers instead of installing tools.
- SREs and ops engineers who want a portable kit of probes (network, JSON, scripting) that runs anywhere Docker runs.
Verified against your live environment
An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed, not multiple choice, real-world proficiency.
More labs like this
Running Containers with docker run and kubectl
Run nginx:alpine first with docker run then with kubectl run on the same VM, and see how Kubernetes maps onto Docker concepts.
Deploy Multi-Container Apps with Docker Compose
Author a compose.yaml that runs nginx, a Python API, and Postgres as a single declarative multi-service stack.
Speed Up Docker Builds with Layer Caching and dockerignore
Refactor a slow Dockerfile to leverage layer caching, add a .dockerignore to shrink the build context, and inspect the resulting image with docker history and docker diff.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Getting Started with Docker IDE
- 02
Run a Throwaway Alpine Shell with the --rm Flag
1 automated check
- 03
Use BusyBox as a Portable Network Toolkit
1 automated check
- 04
Pipe Host stdin Through a jq Container
1 automated check
- 05
Run Python Scripts Without Installing Python on the Host
1 automated check
Not the lab you were looking for?
Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.