Skip to content

Instantly share code, notes, and snippets.

View theoyrus's full-sized avatar
🎯
Focusing

Suryo Prasetyo W theoyrus

🎯
Focusing
View GitHub Profile
@MichaelSimons
MichaelSimons / RetrievingDockerImageSizes.md
Last active May 3, 2024 12:41
Retrieving Docker Image Sizes

Retrieving Docker Image Sizes

There are two metrics that are important to consider when discussing the size of Docker images.

  1. Compressed size - This is often referred to as the wire size. This affects how fast/slow images can be pulled from a registry. This impacts the first run experience on machines where images are not cached.
  2. Uncompressed size - This is often referred to as the size on disk. This affects how much local storage is required to support your Docker workloads.

The example commands shown below will work on Windows, MacOS, and Linux.

How to Measure the Compressed Size

@a-shevtsov
a-shevtsov / Jenkinsfile
Created October 6, 2018 01:08
Running Docker container in Jenkins scripted pipeline
node {
// First parameter represents additional docker run options, second parameter is arguments passed to the image
// docker run [OPTIONS|<First parameter>] IMAGE [COMMAND] [ARG...|<Second parameter>]
docker.image('mesosphere/aws-cli').withRun('--entrypoint /bin/sh', '') {
stage('Build') {
sh 'aws --version'
}
}
}
@monkeym4ster
monkeym4ster / docker.sh
Created July 6, 2017 06:04
Docker: save/load container using tgz file (tar.gz)
#for not running docker, use save:
docker save <dockernameortag> | gzip > mycontainer.tgz
#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz
#load
gunzip -c mycontainer.tgz | docker load
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE