Skip to content

🐳 A set of Bash scripts for building Docker images

License

Notifications You must be signed in to change notification settings

moikot/docker-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Hub Tools

A tiny Docker image with a set of Bash scripts for:

  1. Installing Docker and enabling the experimental mode.
  2. Building and tagging multi-platform Docker images.
  3. Pushing README file to Docker Hub.

Getting the script

Create a container and copy the scripts file from it.

id=$(docker create moikot/docker-tools)
docker cp $id:/scripts.sh /tmp/scripts.sh && docker rm -v $id

Install the latest Docker

/tmp/scripts.sh update_docker

The command updates Docker to the latest version and enables the experimental mode in Docker daemon.

Build multi-platform Docker images

  • Image name: moikot/foobar
  • Git tag: v1.0.0
  • Platforms: linux/amd64, linux/arm64/v8
/tmp/scripts.sh build_images
  moikot/foobar v1.0.0 \
  linux/amd64,linux/arm64/v8 \
  [additional build arguments]

NOTE: Additional build arguments are passed directly to docker buildx build command.

Push README.md to Docker Hub

/tmp/scripts.sh push_readme \
  moikot/foobar README.md \
  [docker_hub_user] [docker_hub_password]