- Daniel Kravetz
- Backend developer
- Devops
- Enjoy hiking with my camera
- No CPU emulation
- No Hypervisor
- Namespaces
- cgroups
- It's just a process managed by the Docker service Note: Unlike a VM, docker doesn't rely on hardware emulation nor hypervisors. It uses namespaces to provide isolation between containers (each container gets its own namespace) and cgroups (control groups) to provide isolation to hardware resources. That said, on non Linux platforms, docker relies on one form of emulation or another, HyperKit for MacOS and HyperV for Windows
- Repeatability
- Portability
- Reusability
- Many more
Note: Repeatability: your container behaves as expected on different computers. Portability: No need to worry about other dependencies. I'll get back to this one in a minute. Reusability: Shared components can be re-used.
which we need to configure, compile and install...
Note: For both MacOS AND linux
Ubuntu configure, make and compile
wget -O libpostal.tar.gz \
https://github.com/openvenues/libpostal/archive/v1.1-alpha.tar.gz && \
tar -xzvf libpostal.tar.gz && \
rm -f libpostal.tar.gz && \
./bootstrap.sh && \
./configure --datadir=/usr/share/ && \
make -j4 && \
make install && \
cd .. && \
rm -fr libpostal-1.1-alpha && \
ldconfig
Note: In order for this to work, you need to install gcc (a C/C++ compiler), know how to configure, compile and install a C++ project (for different platforms!). This is problematic. What happens (line 7) if the path is different between platforms? What if the configuration script (line 6) performs some platform specific instructions?
Note: This implies knowing how to deal with potential errors for different platforms, and makes distribution and deploys significantly harder than they need to be.
Note: What are our options?
We tried the PEX route... Note: PEX files are basically a zip file with superpowers. They are flagged as executable, contain the entire Python runtime, as well as your code, and your dependencies.
...it didn't work out for us Note: This means that we ended up with a LOT of very large PEX files. We had a build system to help us with this, but it still presented all of the same problems, it just simplified deployment and distribution, but nothing else.
Note: Enter docker. What did it bring for us?
- Portability
- Usability
- Fidelity
- No more "but it works on my machine!" Note: Portability: We can ignore the host's OS. Usability: No need to know how to configure and compile Fidelity: The development environment is as close as possible to production And my personal favorite...