Lab 2: Create an image with ADD instruction

Creating Dockerfile

FROM alpine:3.5
RUN apk update
ADD http://www.vlsitechnology.org/pharosc_8.4.tar.gz .

Build Docker Image

docker build -t microfocus/alpine-add . -f <name of dockerfile>

Tagging image as labs-git

docker tag microfocus/alpine-add microfocus/labs-add:v1.0

Verify the Images

docker images

Create a container

docker run -itd microfocus/labs-add:v1.0 /bin/sh
docker ps

Enter into Container Shell

docker attach <<ContainerID>>

Please press “Enter” key twice so as to enter into container shell

ls -ltr

ADD Command lets you to add a tar directly from a link and explode to the container.

Last updated

Was this helpful?