(Superseded) Set up Docker in Virtualbox for 'production' testing

:information_source: This document is no longer maintained. See Contributing to Discourse development

Continuing the discussion from What is “Meta”?:

I think I will, except I’ll use VirtualBox instead of a cloud server. Just to be different than what you suggested :P.

Log:

  • Got ubuntu-13-10-server-amd64.iso
  • Running install right now [15:44 PST]
  • Refusing that silly Ubuntu Landscape™ proposal
  • On the “Software Selection” screen, I mark only PostgreSQL database. This is not necessary.
  • [15:50 PST] Install is done, I have a user shell.

Installing Docker

  • The first thing it asks me to do, install linux-image-extra, does nothing but set the image to manually installed. This means I’ll have to manually remove it if by any chance I do several kernel upgrades in the future and want to clean out old crap.
  • gpg: "36A1D786925C890F966E92D857A8BA88D21E9 is not a key ID: skipping well that’s wonderful, I mean, I went to all the trouble of typing it in.
  • Aha, if I add the repository to my sources and update, apt-get gives me the correct key ID: because the public key is not available: NO_PUBKEY D8576A8BA88D21E9 (which happens to be the ending part of that long hex string). Running the key fetch-and-add with that shorter hex string (D8576A8BA88D21E9) works right away.
  • Done installing Docker, it’s [16:01 PST].

Getting the Discourse docker image

  • As root, mkdir /var/docker, adduser kane docker, and install -g docker -m 2775 -d /var/docker.
  • Start following the Getting Started section
  • Git clone fails - git isn’t installed! Heh.
  • Hmm, it’s getting permission denied - I’ll just switch into root instead of relying on groups.
  • I guess I’ll just put fake info in for the hostname stuff. I do own riking.org, but cba to set it up right now
  • The ssh_key is important. It’s in the format of the ~/.ssh/id_rsa.pub file. Surround it in quotes. Example

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSnKNsGL1muizhZ/QN/2xNkIvoeG3AkeWz/0SV/AaVKxnsMvbTHIJXe2vle6lSU/6YRRr/BCsCIrZb4qk0/vlx/p5pJmqhT7Wp8XIYnmBGO5B38PT2aycKoHIWT3Os9ExmyrFfClOrjfcUxzE1pF43myqDD0B7SpmzBWcMLDpl5D2pza4EmsOgF6eB0OGDmM9gBA9wswHa9At2337heZAN/bVRZ49YpAG02gTuQuVdb00ioQpv6rAZUsANiQh0XycqHvE0RBvGlwjfLHGe9GYYPrKLeFPLeKreERbfWnM5PAmexLG0I09WvyY3ChN0X9y6KH5Q1b+vWAMwIV9dyuRZ root@ubuntu

  • [16:12 PST] Starting ./launcher bootstrap app
  • [16:22 PST] Bootstrap done, (note that it took 10 minutes) ./launcher start app succeeds, a little port forwarding setting in VirtualBox, and:

Success! :smile:

8 Likes

Awesome! What areas of the doco need love?

I’d mention something about the keys problem I had.

Maybe bold the “and re-login” in Before You Start #5.

What format does ssh_key need to be in? Might take a lot of typing, cause it’s not the fingerprint.

@sam where is the meta category in the above install? And the “next step for forum admins” topic?

looks like a regression, sorting out meta now. going to need copy

  • Admin quick start guide (no category)

  • Meta category, same as the one here, same category definition

  • “What is Meta” topic, meta category, same as the one here

I’m actually loving having the VM set up - whenever I need to test something, the server was savestated with it running, so all I need to do is go to /admin/docker, refresh once, hit upgrade, and test it out.

2 Likes

May I know if this setup using VirtualBox NAT?
I was setting up discourse using Bridged networking from home and get it up and running, but once I went into office network it is not working anymore.

Trying to switch to NAT and port forwarding guest(80), host(10080) but not successful.

But looks like the registration email went out correctly during the first startup in bridged mode in office network.(I set it up to use office SMTP server at home so the registration email didn’t go though). I want to set this up as a demo to co-workers.Still investigating…

Is there a way to use a symlink to install plugins with the Docker Development setup? Or do you have to clone the repo in the plugins folder?

Trying to figure out the best way to do plugin development with this setup (had been using vagrant before).

Can anyone help me to install Docker with Discourse on Virtualbox on my laptop? I am using Ubuntu? Thank you!