8.1 Pakaging Git with a Dockerfile
Name the new file Dockerfile. Write the following five lines and then save the file:
# An example Dockerfile for installing Git on Ubuntu
FROM ubuntu:latest
LABEL maintainer="dia@allingeek.com"
RUN apt-get update && apt-get install -y git
ENTRYPOINT ["git"]
build a new image with the Dockerfile
don’t forget the ‘.’ , represent the current directory
docker image build --tag ubuntu-git:auto .
now you can run a Git command using the new image:
docker container run --rm ubuntu-git:auto