From d91cab01bc78626091b5cc70964bed444994a761 Mon Sep 17 00:00:00 2001 From: Ryan Sanford Date: Tue, 7 Feb 2017 11:52:31 -0600 Subject: [PATCH] Fix base image creation example commands (#1409) Example commands for creating a base image do not work due to multiple issues. - 16:04 not a valid tag for ubuntu image - apt-get install fails without preceeding `apt-get update` - gcc command fails without `-nostartfiles` flag - `docker run` without the `--rm` leaves behind containers which is unintuitive, and inconsistent with the build image used above. --- engine/userguide/eng-image/baseimages.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/userguide/eng-image/baseimages.md b/engine/userguide/eng-image/baseimages.md index 691a4824fc..eec5d82657 100644 --- a/engine/userguide/eng-image/baseimages.md +++ b/engine/userguide/eng-image/baseimages.md @@ -60,11 +60,11 @@ Assuming you built the "hello" executable example [from the Docker GitHub exampl NOTE: Because Docker for Mac and Docker for Windows use a Linux VM, you must compile this code using a Linux toolchain to end up with a Linux binary. Not to worry, you can quickly pull down a Linux image and a build environment and build within it: $ docker run --rm -it -v $PWD:/build ubuntu:16.04 - container# apt-get install build-essential + container# apt-get update && apt-get install build-essential container# cd /build - container# gcc -o hello -static hello.c + container# gcc -o hello -static -nostartfiles hello.c -Then you can run it (on Linux, Mac, or Windows) using: `docker run hello` +Then you can run it (on Linux, Mac, or Windows) using: `docker run --rm hello` This example creates the hello-world image used in the tutorials. If you want to test it out, you can clone [the image repo](https://github.com/docker-library/hello-world)