Dockerfile library

(Updated Oct 28, 2017)

Here are some scripts and Dockerfiles to build docker images. There are images for:

Ways to download a file via HTTP from the command line

Current Ubuntu distributions do not come with either wget or curl installed, but they do include Python and Perl. Here are some alternative ways to download a file and print it on stdout without wget or curl:

Shaing your home directory between Mac OSX and a VMware Fusion 7 Linux Virtual machine

First, give your virtual machine a fixed IP address.  VMWare Fusion's dhcpd server will often change the IP address assigned to your virtual machine -- even while it's still running.  While you can give the entire IP address range block access to your home directory over NFS, that can disrupt some other tools like Vagrant.

% cat /etc/exports
/Users/wtanaka -maproot=root:wheel

Restart nfsd in Mac OS:

% sudo nfsd stop
% sudo nfsd start

Assigning a fixed IP address to a virtual machine in VMware Fusion 7

1. Find the dhcpd.conf corresponding to the network that your virtual machine is on.  By default the NAT network uses /Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf. You can find the right one by running ifconfig (or ipconfig in Windows) inside your virtual machine to find its IP address, and look for a range containing that IP address in all of the dhcpd.conf files.

2. Edit the file to add the portions in green.  Be careful not to use a number in the dynamically allocated range, the host computer's IP, or the DNS IP:

Deleting a single URL from Chrome History

  1. Go to chrome://history/
  2. Search for the URL in the "Search history" text field
  3. Click and shift click to select all instances
  4. Click "Remove selected items"

Thrift vs Protocol Buffers vs Avro in Python

Thrift, Protocol Buffers, and Avro are modern software projects which all contain an IDL-enabled data serialization format with Python support. One might think that because they all have an IDL that they all would enforce some level of type safety even in Python, but one would be wrong:

What is Docker?

Docker is a long-lived daemon process with a thin CLI client which makes it easy to clone() new processes with their own PID namespaces, network interfaces, root filesystem, mounts, and hostname.

A docker image contains a filesystem tree (actually an aufs filesystem which allows one image to be implemented as a "layer" on top of another more "base" image).

A Dockerfile is a list of instructions for building a docker image.

AWS Groups vs Roles vs Policies

A short overview of terms used by the system that Amazon Web Services (AWS) uses to manage user accounts, roles, permissions and groups:

Running Ubuntu 14.04 inside VMWare Fusion

To get shared folders to work in VMWare Fusion with a Linux guest, I needed to reinstall vmware tools:

  1. sudo
  2. install vmware tools from the menu

I couldn't get my home directory to work over hgfs (lightdm would log me in and then the session would immediately exit), so I created an entry in /etc/exports on my mac.

What is Ansible?

Ansible is a python command line program. In its basic usage, it reads a list of server hosts (the "inventory"), has access to a library of command line scripts ("modules") that might be run on the servers, and reads a configuration file ("playbook") which specifies modules to run on each server, and parameters to pass to each module. Using the sequence defined in the playbook, it connects to each server with SSH, copies (SFTP or SCP) the module up to the server, executes it remotely, then deletes it.


Subscribe to RSS - Tech