diff --git a/divorce_your_linux_admin.rst b/divorce_your_linux_admin.rst index e8a3a00..ad1bcf8 100644 --- a/divorce_your_linux_admin.rst +++ b/divorce_your_linux_admin.rst @@ -235,6 +235,101 @@ Let's Do This Already --------------------- +The steps below should be done *in the order given*. + +Whenever it says, "create a new ``docker`` container", do so with the +``--security-opt seccomp=unconfined`` option. + +This example assumes CentOS/RedHat7 docker images, so the native +package management commands are based on ``yum``. + +This example assumes that we want to build our tools tree under +``/opt/TundraWare/tools``. Feel free to use your own directory +location, but do so consistently throughout the process. + +Make sure the user doing all this has write access to your target +tools directory. + +This example assumes that ``/shared`` is common to both the host +and docker instances. It's where we'll preseve our tarballs and +other project artifacts across container rebuilds. + +First, we're going to create the bootstrap instance: + + 1) Create a new docker image. Log in as or become root on it. + Then:: + + yum -y groupinstall "Development Tools" + + 2) Now login or revert back to being an unprivileged user. + Then:: + + git clone https://github.com/Linuxbrew/brew.git /opt/TundraWare/tools + + 3) Update the path to search our new tools tree for things first. + It's a good idea to also put this into ``.bashrc`` and then copy it + to ``/shared`` for future use:: + + export PATH="/opt/TundraWare/tools/bin:/opt/TundraWare/tools/sbin:$PATH" + + 4) Now, bootstrap the environment using the native OS compiler tools:: + + brew install git # This also conveniently installs gcc and the supporting cast + brew install make file-formula + + 5) Save the result:: + + tar -czvf /shared/bootstrap-linuxbrew.tar.gz /opt/TundraWare/tools + +Now we can build a freestanding instance of the tools tree without (almost) any +OS tools. The example below should be tuned for the packages you want: + + 1) Create a new docker image. Log in as or become root on it. Then install + the minimal set of tools required to accommodate the previously described + package build silliness:: + + yum -y install perl autoconf automake make + + *Make sure the native development tools are NOT otherwise installed in this instance.* + + 2) Install our bootstrap environment:: + + tar -xzvf /shared/bootstrap-linuxbrew.tar.gz -C / + + + 3) Fixup the path as in step 3) above. + + + 4) Do some housekeeping:: + + brew config # Check the environment + brew prune # Tidy up from the bootstrap build + brew cleanup # Get rid of old build artifacts + brew doctor # Check to make sure things look OK + + 5) Now we can start installing our desired packages. Note that + we are now using *the ``linuxbrew`` compiler chain*, NOT the + system tools:: + + brew install coreutils bash bc gnu-sed awk flex bison tree htop the_silver_searcher gnu-which less # also installs python2 + ln -s /opt/TundraWare/tools/bin/python2 /opt/TundraWare/tools/bin/python + ln -s /opt/TundraWare/tools/bin/pip2 /opt/TundraWare/tools/bin/pip + brew install perl go + brew install screen tmux + brew install emacs joe vim + brew install nmap nload + ... and so on. + + 6) Save the results:: + + tar -czvf /shared/full-linuxbrew.tar.gz /opt/TundraWare/tools + + +You should now be able to install and use this tool tree on a +docker, VM, or physical Linux instance by doing this:: + + tar -xzvf /shared/full-linuxbrew.tar.gz /opt/TundraWare/tools + export PATH="/opt/TundraWare/tools/bin:/opt/TundraWare/tools/sbin:$PATH" Gotchas @@ -253,7 +348,6 @@ on a host with the kernel version of interest. - Resources --------- @@ -265,6 +359,12 @@ https://github.com/Linuxbrew +If you run into a problem building a package, run this command:: + + brew gist-log package-name + +This produces a Github gist URL you can submit to the devs for help. + Author ------