Giter Site home page Giter Site logo

devbox's Introduction

Devbox for Mac

This project will setup a Vagrant environment with a ready to use Docker environment.

Why

Docker for Mac is horrible. Slow, file permissions management is wrong, docker configuration is likely to break for people using a Linux system. Basically, you don't have the correct Docker experience on a Mac.

Solution

Use a real Linux system from within your Mac: welcome (back) Vagrant. The current solution does not used shared folder from Vagrant. But rely on built-in features of IDE:

Installation

brew cask install virtualbox
brew cask install vagrant
vagrant plugin install vagrant-disksize

mkdir -p Documents/devbox
cd Documents/devbox

curl -sL https://raw.githubusercontent.com/ekino/devbox/master/Vagrantfile -o Vagrantfile

vagrant up # This command can take up to 5min.

Manual Post-Operations

Accessing the box

Copy the output of vagrant ssh-config --host devbox into your ~/.ssh/config file.

You should be able to connect to the box using ssh devbox.

Configure your git information

ssh devbox
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"

Dedicated SSH Key

A dedicated key has been created for you. It will be display after the provisionning. You can access to it using:

cat ~/.ssh/id_ed25519_devbox

Of course, you are free to re-import any keys inside the box.

Using a dedicate key helps to avoid avoid one key for all usages. You can have a key for pushing code to repositories. And a key (on the host) to connect to servers. So if a dependency is bloated with a malware, your servers' keys are not exposed.

Don't forget to share your public key to services that may required it.

Importing projects

rsync -av ~/projects-folder devbox:~/projects

Accessing projects

By default the box does not bind any port to the guest. Please point any request to the VM IP: 172.16.3.2

VSCODE Integration

Configuring VSCode

  • Make sure you have vscode installed on your laptop.
  • Install the vscode extension: https://aka.ms/vscode-remote/download/extension
  • Make sure you can connect to the box using ssh devbox
  • Remote-SSH: Connect to Host from the Command Palette and enter devbox
  • You can now list projects available on the box.

Configuring VSCode's extensions

  • By default, VSCode install extensions on the host. Now you have an second option to also install an extension on the box.
  • So, you can loop through your installed extensions and click on Install on SSH...

References

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.