GithubHelp home page GithubHelp logo

pentatonicfunk / vagrant-docker-baseimages Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tknerr/vagrant-docker-baseimages

0.0 1.0 0.0 49 KB

A collection of Vagrant-friendly docker base images

License: MIT License

Ruby 58.03% Dockerfile 41.97%

vagrant-docker-baseimages's Introduction

Vagrant-friendly Docker Base Images

Circle CI

A collection of Vagrant-friendly docker base images + corresponding Vagrant baseboxes. Something inbetween the official distro base image and puhsion/baseimage, just enough to make it work with Vagrant.

On top of the official distro base image it includes:

  • the vagrant user (password vagrant) with passwordless sudo enabled
  • the vagrant insecure public key in ~/.ssh/authorized_keys
  • sshd running in the foreground

Vagrant Baseboxes

The intended use of the Vagrant-friendly docker base images is to use them as a basebox in your Vagrantfile. These baseboxes simply reference one of the actual docker base images below.

The following baseboxes are currently published on Vagrant Cloud:

Usage

Use the config.vm.box setting to specify the basebox in your Vagrantfile.

For example, run vagrant init tknerr/baseimage-ubuntu-18.04 --minimal to create the Vagrantfile below:

Vagrant.configure(2) do |config|
  config.vm.box = "tknerr/baseimage-ubuntu-18.04"
end

Then, running vagrant up --provider docker should look similar to this:

W:\repo\sample>vagrant up --provider=docker
Bringing machine 'default' up with 'docker' provider...
==> default: Creating the container...
    default:   Name: minimal_default_1441605508
    default:  Image: tknerr/baseimage-ubuntu:18.04
    default: Volume: /w/repo/sample:/vagrant
    default:   Port: 0.0.0.0:2222:22
    default:
    default: Container created: f366398390f6b33f
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 192.168.59.104:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!

Docker Base Images

In case you want to work with the actual docker base images directly, the following ones (see subdirectories) are available on docker hub:

Usage

You can use it in your Vagrantfile in it's most simple form like this and then run vagrant up:

Vagrant.configure(2) do |config|
  config.vm.provider "docker" do |d|
    d.image = "tknerr/baseimage-ubuntu:18.04"
  end
end

If you want to use provisioners, you need to additionally tell vagrant that this container has ssh enabled:

Vagrant.configure(2) do |config|
  config.vm.provider "docker" do |d|
    d.image = "tknerr/baseimage-ubuntu:18.04"
    d.has_ssh = true
  end

  # use shell and other provisioners as usual
  config.vm.provision "shell", inline: "echo 'hello docker!'"
end

Contribute

How to contribute?

  1. fork this repo
  2. create a new branch with your changes
  3. submit a pull request

License

MIT - see the accompanying LICENSE file

vagrant-docker-baseimages's People

Contributors

tknerr avatar svenbayer avatar

Watchers

James Cloos avatar

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.