Code Monkey home page Code Monkey logo

acng-container-util's Introduction

acng-container-util

An interactive utility to use apt-cacher-ng ("acng" in short) docker container minimum2scp/apt-cacher-ng:latest.

Requirements

  • ruby
  • bundler
  • docker
  • docker-compose
  • peco

Installation

Checkout the code

git clone https://github.com/minimum2scp/acng-container-util.git /path/to/acng-container-util

bundle install

cd /path/to/acng-container-util
mkdir -p vendor/bundle
bundle install --path vendor/bundle

Configure shell

Add the initialization code to your zshrc

export PATH=/path/to/acng-container-util/bin:$PATH
eval "$(acng init)"

or

export PATH=/path/to/acng-container-util/bin:$PATH
acng_precmd_hook (){
  if [ -f /tmp/apt-cacher-ng.${USER}/http_proxy.sh ]; then
    . /tmp/apt-cacher-ng.${USER}/http_proxy.sh
  fi
}
autoload -Uz add-zsh-hook
add-zsh-hook precmd acng_precmd_hook

Usage

% bin/acng
Commands:
  acng help [COMMAND]  # Describe available commands or one specific command
  acng init            # define acng shell function for bashrc, zshrc
  acng log             # view apt-cacher-ng container logs
  acng set             # set environment variable http_proxy (to eval)
  acng start           # start apt-cacher-ng container
  acng status          # status apt-cacher-ng container
  acng stop            # stop apt-cacher-ng container
  acng unset           # unset environment variable http_proxy (to eval)

Use apt-cacher-ng with apt-get

% acng start
% acng set
% sudo http_proxy=${http_proxy} apt-get update
% sudo http_proxy=${http_proxy} apt-get dist-upgrade

Use apt-cacher-ng with docker build

% acng start
% acng set
% cd /path/to/your-docker-image
% docker build --build-arg http_proxy=${http_proxy} .

acng-container-util's People

Contributors

minimum2scp avatar

Watchers

 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.