Docker image with CentOS GNU/Linux.
This is a set of scripts designed to create Docker images with CentOS GNU/Linux.
The Docker images resulting from these scripts should be the ones used to instantiate a CentOS container.
There are a couple of things needed for the script to work.
Docker, either the Community Edition (CE) or Enterprise Edition (EE), needs to be installed on your local computer.
Docker installation instructions can be found here.
In order to create a Docker image using this Dockerfiles you need to run the
docker
command with a few options.
docker image build --force-rm --no-cache --progress plain --file <VARIANT>/Dockerfile --tag <USER>/<IMAGE>:<TAG> <PATH>
<USER>
- [required] The user that will own the container image (e.g.: "johndoe").<IMAGE>
- [required] The container name (e.g.: "centos").<TAG>
- [required] The container tag (e.g.: "latest").<PATH>
- [required] The location of the Dockerfile folder.<VARIANT>
- [required] The variant that is being build (centos7
,centos8
,centos8-stream
orcentos9-stream
).
A build example:
docker image build --force-rm --no-cache --progress plain --file centos9-stream/Dockerfile --tag johndoe/my_centos:centos9-stream .
To clean any none
image(s) left by the build process the following
command can be used:
docker image rm `docker image ls --filter "dangling=true" --quiet`
You can also use the following command to achieve the same result:
docker image prune -f
Additional tags can be added to the image using the following command:
docker image tag <image_id> <user>/<image>:<extra_tag>
After adding an image to Docker, that image can be pushed to a Docker registry... Like Docker Hub.
Make sure that you are logged in to the service.
docker login
When logged in, an image can be pushed using the following command:
docker image push <user>/<image>:<tag>
Extra tags can also be pushed.
docker image push <user>/<image>:<extra_tag>
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Please read the CONTRIBUTING.md file for more details on how to contribute to this project.
This project uses SemVer for versioning. For the versions available, see the tags on this repository.
- Frederico Martins - fscm
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details