Skip to content

Instantly share code, notes, and snippets.

@Gyarbij
Created June 5, 2023 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gyarbij/14d7894ebd81cd302ad305327acadfd0 to your computer and use it in GitHub Desktop.
Save Gyarbij/14d7894ebd81cd302ad305327acadfd0 to your computer and use it in GitHub Desktop.
A quick and simple getting started for building docker images locally and pushing to docker hub.

Run docker build -t <your_username>/my-private-repo . to build your Docker image.

Run docker run <your_username>/my-private-repo to test your Docker image locally.

Run docker push <your_username>/my-private-repo to push your Docker image to Docker Hub.

You need to add a dot, which means to use the Dockerfile in the local directory.

For example: docker build -t mytag .

docker buildx build -t gyarbij/dockerimg:latest .

docker buildx build --platform linux/amd64,linux/arm64/v8,linux/arm/v7 -t gyarbij/dockerimg:latest --push .

https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment