• Stars
    star
    105
  • Rank 326,281 (Top 7 %)
  • Language
    Shell
  • Created over 10 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Packer scripts to build a Vagrant-compatible boot2docker box.

boot2docker Vagrant Box

This repository contains the scripts necessary to create a boot2docker Vagrant box compatible with Parallels provider. If you work solely with Docker, this box lets you keep your Vagrant workflow and work in the most minimal Docker environment possible.

Docker installation

Docker client should be installed on your Mac. It is bundled to Docker Toolbox

Usage

The box is available on Atlas, making it very easy to use it:

vagrant init parallels/boot2docker
vagrant up

Then you need to prepare your environment for Docker client

If TLS is enabled (by default):

# Copy TLS certificates from the VM to `./tls/` directory on your Mac host:
vagrant ssh -c "sudo cp -r /var/lib/boot2docker/tls `pwd`/"

export DOCKER_TLS_VERIFY="1"
export DOCKER_CERT_PATH="`pwd`/tls"
export DOCKER_HOST="tcp://`vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp"`:2376"

If TLS is disabled:

Use these commands to disable TLS for Docker daemon (you should do it only once, after the initial vagrant up):

vagrant ssh -c "sudo sh -c 'echo \"export DOCKER_TLS=no\" > /var/lib/boot2docker/profile'"
vagrant reload

Now you just need to set DOCKER_HOST variable:

unset DOCKER_TLS_VERIFY
export DOCKER_HOST="tcp://`vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp"`:2375"

That's it! Now your VM can be used as Docker host, check it:

docker version
...

Shared Folders

/Users path on you Mac is shared with boot2docker VM by default. It means that you can mount any directory placed in /Users on your Mac into the container, for example:

docker run -v /Users/bob/myapp/src:/src [...]

If you want to mount any directory outside of /Users, then you should set it (or its parent dir) as a synced folder in your Vagrantfile at first:

config.vm.synced_folder "/tmp/dir_to_share", "/tmp/dir_to_share"

Refer to "Synced Folders - Basic Usage" to get more details about synced folders in Vagrant.

Tips & tricks

  • Vagrant synced folders has been tested with :

    • Parallels Shared Folders : This is default sharing system for Parallels provider

    • NFS : Set B2D_NFS_SYNC environment variable to use NFS for sharing folders:

      $ export B2D_NFS_SYNC=1
      $ vagrant up
  • If you want to tune contents (custom profile, install tools inside the VM), just place a bootlocal.sh script alongside your Vagrantfile. It will be run in the VM automatically each time after vagrant up. Refer to boot2docker FAQ to get more details.

Building the Box

If you want to recreate the box, rather than using the binary, then you can use the scripts and Packer template within this repository to do so in seconds.

To build the box, first install the following prerequisites:

Then run this command to build the box for Parallels provider:

make

Execute this to run integration tests:

make test-parallels

Authors

More Repositories

1

rq-dashboard

Flask-based web front-end for monitoring RQ queues
Python
1,432
star
2

vagrant-parallels

Vagrant Parallels Provider
Ruby
996
star
3

docker-machine-parallels

Parallels driver for Docker Machine https://github.com/docker/machine
Go
468
star
4

artifactory

A Python client for Artifactory
Python
82
star
5

packer-examples

Packer Templates and examples to use with Parallels Desktop provider
HCL
28
star
6

parallels-vscode-extension

Parallels Visual Studio Code
TypeScript
26
star
7

jenkins-parallels

A Jenkins plugin to run builds in Parallels Desktop
Java
23
star
8

githooks

Git Hooks for Atlassian Bitbucket Server (formerly Stash)
Python
17
star
9

RAS-PowerShell

This repository contains sample Parallels RAS PowerShell cmdlets and tools
Rich Text Format
16
star
10

packer-plugin-parallels

Packer plugin for Parallels Builder
Go
11
star
11

prl-devops-service

Go
9
star
12

vagrant-django-example

A simple skeleton of Django application provisioned with Vagrant + Parallels Desktop
Shell
7
star
13

kitchen-policyfile-nodes

Test Kitchen provisioner based on policyfile_zero that generates searchable nodes
Ruby
6
star
14

atlassian-restrict-branch-model

Restrict Development to Branch Model for Atlassian Bitbucket Server
Java
6
star
15

prlctl-scripts

Somes useful scripts to use with Parallels command line to help in automation
Shell
4
star
16

Parallels-DaaS

This repository contains scripts and other useful tools to benefit administrators of the Parallels DaaS (Desktop-as-a-Service) solution
PowerShell
3
star
17

jenkins_cleanup

Groovy script to cleanup Jenkins workspaces
Groovy
3
star
18

joinparallels

We are hiring
2
star
19

PMM-Azure-Script

PowerShell
1
star
20

parallels-desktop-github-action

Parallels Desktop Github Actions
TypeScript
1
star
21

terraform-provider-parallels-desktop

Go
1
star