Sign inSign up

borda/docker_sample

By borda

•Updated 11 months ago

Image
0

1.7K

borda/docker_sample repository overview

⁠Sample Docker Image

Publish Docker Image CircleCI Docker Pulls

⁠Building with CI/CD

This Docker image a basic image with accent on automatic pushing to Docker Hub.

  1. build Docker image in a CI/CD (for particular version)
  2. test the Image in CI/CD (for particular version)
  3. push the Image to Docker Hub (from master only and if credentials are given)

The reason is that DockerHub builds are using weak machines and the build time is very limited compare to GH Actions / CircleCI where you can use up to 5 hours.

⁠Using Github Actions

Advantage of this build is usage of layer caching with sync with Docker Hub, so you build only the changed Docker layers...

The credentials (DOCKERHUB_USERNAME and DOCKER_PASSWORD) has to be set in Github setting - secrets⁠.

⁠Using CircleCI

This contains the very same building workflow as local build...

The credentials (DOCKERHUB_USERNAME and DOCKERHUB_PASS) has to be set in CircleCI environment variables⁠.


⁠Building locally

You can build it on your own, note it takes lots of time, be prepared.

git clone <git-repository>
cd docker_sample
docker image build -t ubuntu:py36 -f Dockerfile --build-arg PYTHON_VERSION=3.6 .

To run build image use following.

docker image list
docker run --rm -it ubuntu:py36 bash
docker image rm ubuntu:py36
⁠Cleaning

In case you fail with some builds, you may need to clean your local storage.

docker image prune

or Docker - How to cleanup (unused) resources⁠

docker images | grep "none"
docker rmi $(docker images | grep "none" | awk '/ / { print $3 }')

or remove all - Some way to clean up⁠

docker rm -vf $(docker ps -aq)
docker rmi -f $(docker images -aq)
docker volume prune -f

Tag summary

Content type

Image

Digest

Size

116 MB

Last updated

almost 6 years ago

docker pull borda/docker_sample