GithubHelp home page GithubHelp logo

geaaru / docker-companion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mudler/docker-companion

0.0 3.0 0.0 2.97 MB

squash and unpack Docker images, in Golang

License: Other

Makefile 6.01% Go 93.99%

docker-companion's Introduction

docker-companion Build Status

docker-companion is a candy mix of tools for docker written in Golang and directly using Docker API calls. As for now it allows to squash and unpack an image.

Reinventing the wheel?

Problem arises with current tools to squash/unpack images since mostly of them are scripted. I personally needed a static implementation with no-deps hell that i could use in my CI pipeline easily (and also to get the job done).

Download and unpack image

Note: Doesn't require a docker daemon running on the host.

docker-companion download my-awesome-image /unpacked_rootfs

Downloads and reconstruct all the image layers, unpacking the content to the directory given as second argument.

Squash an image

The resulting image will loose metadata, but it is handy to reduce image size:

docker-companion squash my-awesome-image my-awesome-image-squashed

You can also make it pull before squashing it:

docker-companion --pull squash my-awesome-image my-awesome-image-squashed:mytag

Or just squashing an image

docker-companion squash my-awesome-image

to directly remove the intermediary (the source image, which will loose the tag)

docker-companion squash --remove my-awesome-image

Unpack an image

docker-companion unpack my-awesome-image /my/path

The path must be absolute, and you must run it with root permission to keep file permissions.

You can squash the image right before unpacking it too:

docker-companion --pull unpack --squash my-awesome-image /my/path

It can be handy sometimes to squash the image before unpacking it (very few cases where the latter fails)

You can supply also the --fatal global option to treat all warnings as fatal:

docker-companion --fatal --pull unpack --squash my-awesome-image /my/path

Get Latest release from github for amd64

curl -s https://api.github.com/repos/mudler/docker-companion/releases/latest \
| grep "browser_download_url.*amd64" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -i - -O docker-companion

docker-companion's People

Contributors

geaaru avatar mudler avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.