Lab 1: Docker Basics

Create a folder called myapp

mkdir myapp && cd myapp

Creating Dockerfile

nano Dockerfile

add the below lines to the Dockerfile

FROM alpine:3.5
RUN apk update
RUN apk add git

Build Docker Image

docker build -t microfocus/alpine-git .

Tagging image as labs-git

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

Verify the Images

docker images

Create a Simple docker Container

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

Enter into Container Shell

Login to the Docker Container using Container ID

docker attach <<ContainerID>>

Verify if GIT is installed

Run the Command inside the container

git --version

Last updated

Was this helpful?