Here's how to save and load docker images:
Example scenario: To save a docker image from a docker repository and save it as a tar file locally.
- Save the image as a tarball
docker save repositoryname:tag > repotag.tar
- Zip the image
| # Base image | |
| FROM openjdk:17.0.2-jdk-slim | |
| # Metadata | |
| LABEL maintainer="yooresh" | |
| LABEL description="OpenJDK 17 with 7-Zip installed" | |
| # Install 7-Zip | |
| # openjdk:17.0.2-jdk-slim is Debian-based, so we use apt | |
| RUN apt-get update && \ |
| #!/usr/bin/env bash | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # to_jalali.sh — Convert Gregorian datetime to Jalali (Shamsi/Persian) | |
| # | |
| # Supported input formats: | |
| # "2025-05-20 23:51:32.961770 +03:30" explicit offset | |
| # "2025-05-20T23:51:32.961770Z" UTC (Z suffix) | |
| # "2025-05-20T23:51:32Z" UTC, no microseconds | |
| # "2025-05-20 23:51:32.961770" no tz → implied Tehran (+03:30) | |
| # "2025-05-20" date only → implied Tehran, 00:00:00 |
| package com.github.younesrahimi.utils; | |
| import org.jspecify.annotations.NonNull; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.http.HttpRequest; | |
| import org.springframework.http.client.ClientHttpRequestExecution; | |
| import org.springframework.http.client.ClientHttpRequestInterceptor; | |
| import org.springframework.http.client.ClientHttpResponse; |
| #--- Build tun2socks and udpgw (as the user who will use the proxy) --- | |
| mkdir -p $HOME/src | |
| cd $HOME/src | |
| git clone "https://github.com/ambrop72/badvpn" | |
| cd badvpn | |
| mkdir -p build | |
| cd build | |
| export OUTDIR=$PWD | |
| export SRCDIR=$(dirname $PWD) |
| ### The original Author of this package had enabled CloudFlare JS verification. As a result, this automated script will not work. | |
| ### Therefore you have to download each package and install it manually. | |
| ## Change Directory | |
| cd /tmp/ | |
| ## Update opkg | |
| opkg update | |
| ## If wget not installed already |
| package reports | |
| import com.github.mfathi91.time.PersianDate | |
| import java.time.ZoneId | |
| val TEHRAN_ZONE_ID = ZoneId.of("Asia/Tehran") | |
| fun Int.format(paddingZeroCount: Int): String = String.format("%0${paddingZeroCount}d", this) | |
| val months = listOf( |
| package com.github.util | |
| import java.security.SecureRandom | |
| import java.util.* | |
| import javax.crypto.Cipher | |
| import javax.crypto.spec.IvParameterSpec | |
| import javax.crypto.spec.SecretKeySpec | |
| import org.slf4j.LoggerFactory | |
| /** |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "math/rand" | |
| "time" | |
| ) | |
| type Matrix [][]int |
| // This can be imported via ./bin/gremlin.sh -i describe.groovy | |
| // A variable 'graph' must be defined with a JanusGraph graph | |
| // Run it as a plugin command ':schema' | |
| // :schema describe | |
| // | |
| import org.janusgraph.graphdb.database.management.MgmtLogType | |
| import org.codehaus.groovy.tools.shell.Groovysh | |
| import org.codehaus.groovy.tools.shell.CommandSupport |
Here's how to save and load docker images:
Example scenario: To save a docker image from a docker repository and save it as a tar file locally.
docker save repositoryname:tag > repotag.tar