Coder Social home page Coder Social logo

apt-container's Introduction

apt-container โ€” a cleaner way to build your Docker images

Go Reference

apt-container is a wrapper around apt-get to help keep your Dockerfiles/Containerfiles slim, while still using good layering practices for Apt.

Example: Best-practices normal Dockerfile

# Installing straight up
RUN apt-get update -q && \
    apt-get install -y -q git python3 figlet && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists

# Installing from a file
COPY mypackages.txt ./
RUN apt-get update -q && \
    apt-get install -y -q $(cat mypackages.txt) && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists
# Better hope the file is not CRLF or has no comments!

Using apt-container to reduce the Apt commands to one-liners:

# Installing straight up
RUN apt-container install git python3 figlet

# Installing from a file
COPY mypackages.txt ./
RUN apt-container install -r mypackages.txt

Install me by using this command, or by building the binary from source.

go install github.com/fsufitch/apt-container@latest

Usage

$ apt-container install --help
NAME:
   apt-container install

USAGE:
   apt-container install [command options] packages...

DESCRIPTION:
   container-friendly version of 'apt-get install' (see apt-get man pages)

OPTIONS:
   --interactive                    run interactively (include -y in apt-get commands) (default: false)
   --simulate, -s                   run in simulated mode (include -s in apt-get commands) (default: false)
   --no-update, -U                  skip running 'apt-get update' before installing (default: false)
   --keep-cache, -C                 keep package cache after install; don't run 'apt-get clean' (default: false)
   --keep-lists, -L                 keep package lists used for install (default: false)
   --apt-lists-dir value            directory that apt keeps its stuff (default: "/var/lib/apt/lists")
   --extra-options value, -o value  options to passthrough to the apt-get command
   --quiet value, -q value          how many '-q' to pass to apt-get (default: 1)
   --requirements FILE, -r FILE     read package list from FILE (one per line, # is a comment); mutually exclusive with packages as arguments
   --help, -h                       show help

apt-container's People

Contributors

fsufitch avatar

Watchers

 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.