DOCKER · Start here · 5 min
Build the supplied image
Turn a Dockerfile into a tagged image.
Not completedYour task
Build the supplied Dockerfile using the image tag opsrung-build:practice. Keep its default command unchanged.
What you’re aiming for
- The image opsrung-build:practice exists.
- Running the image prints Practice ready.
1. Prepare your practice folder
Use a running Docker engine in Linux container mode. The setup commands below use a Bash-compatible shell: Git Bash on Windows, or Bash on Linux/macOS.
Create a new, empty folder for this exercise. If that name already exists, choose another new name. Continue only after you’re inside the new folder.
mkdir opsrung-docker-build-image && cd opsrung-docker-build-image
Run these setup commands in that folder:
cat > Dockerfile <<'DOCKERFILE' FROM alpine:3.22 USER 65534:65534 CMD ["echo","Practice ready"] DOCKERFILE
Docker may download the official Alpine image and, for the web task, its HTTP package. If an example container name already exists, use a different name consistently. If port 8088 is occupied, choose another free local port.
2. Try the task
Work toward the goal above. Start by inspecting the files or resources, then use a hint if you need one.
Hint 1
Work in the folder where you saved the Dockerfile during setup.
Hint 2
docker build uses a tag and a build context.
Hint 3
Use docker build -t opsrung-build:practice . from the practice folder.
3. Review your result
Use these commands to look at your result and compare it with the goals. The website does not run or verify them.
docker image inspect opsrung-build:practice docker run --rm --network none opsrung-build:practice
What you should see
- docker image inspect opsrung-build:practice displays the image details successfully.
- docker run --rm --network none opsrung-build:practice prints Practice ready.
If your result differs: Build from the folder containing Dockerfile, use the exact image tag, and include the final dot to select the build context.
Compare with one possible solution
docker build -t opsrung-build:practice .
Other approaches are fine if you reach the same goal. Opening this solution does not mark the exercise complete.
Clean up this exercise
Only remove the example resources you created. Volume cleanup deletes that exercise’s saved sample data. Keep anything you need.
docker image rm opsrung-build:practice
Finished this exercise?
You decide when you’re done. Your choice is saved in this browser, and you can change it later.