Skip to content

maikelvdh/docker_utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker Utility Tools

This repository is containing several useful docker utility tools. See sections below for specific details of the tools.

Docker Image commands

This tool will output the commands used to create a Docker image. It is traversing up-to the top-most inherited Docker image. The image argument passed as argument is based on the official NAME[:TAG|@DIGEST] convention.

Usage

Bash usage:

$ ./docker_image_commands.sh <image1> <image2> <...>

Docker usage:

$ docker build -t docker_image_commands .
$ docker run docker-image-commands <image1> <image2> <...>

Examples

Get ubuntu:14.04 commands:

$ ./docker_image_commands.sh ubuntu:14.04
Docker image 'library/ubuntu:14.04' is created with the following commands:
	/bin/sh -c #(nop) ADD file:84479dd43530d358e10fc77876bb6f83e71e1367d959e423f2471e0057c4b424 in /
	/bin/sh -c set -xe 		&& echo '#!/bin/sh' > /usr/sbin/policy-rc.d 	&& echo 'exit 101' >> /usr/sbin/policy-rc.d 	&& chmod +x /usr/sbin/policy-rc.d 		&& dpkg-divert --local --rename --add /sbin/initctl 	&& cp -a /usr/sbin/policy-rc.d /sbin/initctl 	&& sed -i 's/^exit.*/exit 0/' /sbin/initctl 		&& echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup 		&& echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean 	&& echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean 	&& echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean 		&& echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages 		&& echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes 		&& echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests
	/bin/sh -c rm -rf /var/lib/apt/lists/*
	/bin/sh -c sed -i 's/^#\s*\(deb.*universe\)$/\1/g' /etc/apt/sources.list
	/bin/sh -c mkdir -p /run/systemd && echo 'docker' > /run/systemd/container
	/bin/sh -c #(nop)  CMD ["/bin/bash"]


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages