Giter Site home page Giter Site logo

devbox's Introduction

NOTICE: Due to the improved performance of Docker for Mac, DevBox is no longer maintained. Commentary referencing Docker for Mac performance in this file may be outdated.

DevBox

A minimal bootstrapper to turn a brand new Mac into a docker-based dev environment

Installation

To get up and running without cloning the repo:

sh <(curl -fsSL https://rawgit.com/TechnologyAdvice/devbox/master/install/mac_install.sh)

Who is this for?

DevBox was created to standardize development config at TechnologyAdvice, but nothing this script does is company-specific. If you're looking for a great baseline for getting started with Docker-based development on a Mac, DevBox might be a good place to start.

What does it do?

After a successful run, the Mac will have an active, super performant Docker environment. A Docker VM is installed into macOS's native hypervisor (xhyve), and the /Users folder is mounted on it via a local NFS share -- the fastest measured way to mount Docker volumes on a Mac. The VM is also outfitted with FS-EventStream to allow a client on the Mac to forward file change events into the VM. This allows applications like webpack, gulp, nodemon, and any other inotify listener to see when files change on the host. This VM will be autostarted every time the Mac is booted, with the help of a launch agent installed in ~/Library/LaunchAgents.

In addition, DevBox installs DevLab, a docker-compose alternative with built-in FS-EventStream support, which also exposes any container-exposed ports on localhost for the full just-like-Linux experience. It also installs fsbridge, a simple CLI utility for forwarding file change events, in the event that DevLab isn't being used.

Some other software is installed to support the above. That includes:

Note that all software installs are idempotent. For example, if you've already downloaded and installed the official Node.js package from their website, DevBox won't install it again from brew.

Why not use the new Docker for Mac?

Docker for Mac was recently released by the Docker team to automate the process of running Docker inside of xhyve on Mac. At the moment, Docker for Mac does not cover the full scope of development use cases due to various bugs and performance issues, particularly with the problems in osxfs that cause some filesystem-heavy operations to take minutes rather than seconds. DevBox automatically creates a very similar environment, but mounts volumes using the more performant NFS, forwarding fsevents out-of-band.

How can I configure it?

DevBox is just a shell script, so feel free to fork it and modify it for your own needs! Out of the box, you can change the docker-machine name by setting the MACHINE_NAME environment variable before running the script (default is devbox). Also by default, new files created within the VM/container volumes will be owned by your Mac user. For a native Linux experience, edit /etc/exports to remove the -mapall=501:20 argument.

License

DevBox is ISC licensed. See details in LICENSE.txt.

Credits

DevBox was originally created at TechnologyAdvice in Nashville, TN.

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.