Create a Base Image
One of the first things you'll do from a development perspective is create a base image for all of your applications to use. In reality, your platform team typically creates these, and provides them to internal software development teams for usage.
We will create a basic base image for Python applications. Work together in teams of 2-3 people, and create a Dockerfile (
/root/resources/python/Dockerfile) with the following specifications:
- Base it off a recent Alpine Linux version
- Specify a maintainer
- Install Python, Pip, and the dev tools
- Configure the container to always run
Once you have your Dockerfile, build the image:
docker image build -t py /root/resources/python/
Then, to verify that it works properly:
docker container run -d -p 8080:5000 py -m http.server 5000
You should be able to access your filesystem on port 8080.