diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6c4c5cdf3bee1e19ff50e8fcea21c4979ceaf64d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:16.04 +LABEL maintainer="Kevin Lyda <lyda@gitlab.com>" + +EXPOSE 80 22 + +RUN DEBIAN_FRONTEND=noninteractive \ + apt-get install curl openssh-server ca-certificates postfix +ADD app /app + +ENTRYPOINT ["/app/init"] diff --git a/README.md b/README.md index 206abac767c8d6d71ec539e00b69d7a94c530263..23be9b87820d24b6313243613a006faa9a2adf53 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,15 @@ -# Omnibus-Vagrant +# Omnibus-Docker -#### Requirements: -[Virtualbox 5.1+](https://www.virtualbox.org/wiki/Downloads) +## Requirements -[Vagrant 1.9+](https://www.vagrantup.com/downloads.html) +A functioning docker install - locally or remotely. -#### Configure +## Create Image - -Data file gitlab-vagrant.yml contains profiles for each of your vagrant machines. - -Name can be any parseable format, such as: - -- gitlab-edition-version -- gitlab-ticket-number -- gitlab-date - -Example: - -``` ---- -- name: gitlab-ee-latest - version: 9.1.1 - edition: ee - host_port: 9110 - -- name: gitlab-ce-12345 - version: 8.17.3 - edition: ce - host_port: 8173 +```bash +docker build -t omnibus-docker ``` -Make changes to this file and save. - -For the following steps change name to the name of the machine in your profile, i.e. gitlab-ee-12345. - -#### Provision - -`vagrant up name` - -#### Status - -Show all running machines: - -`vagrant global-status` - -Show status of specific machine: - -`vagrant status name` - -#### Connect via SSH - -`vagrant ssh name` - -#### Stop - -`vagrant stop name` - -#### Cleanup - -Once you are finished with the VM you can remove it with: - -`vagrant destroy name` - -#### Reprovision - -To reprovision an existing machine: +## Create container -`vagrant up name --provision` +docker run -ti --rm -e EDITION=ce VERSION=9.1.2 omnibus-docker diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 85be6acfe6d30c65d20353e3b59481eed42eebfd..0000000000000000000000000000000000000000 --- a/Vagrantfile +++ /dev/null @@ -1,37 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Specify minimum Vagrant version and Vagrant API version -Vagrant.require_version ">= 1.6.0" -#VAGRANTFILE_API_VERSION = "2" - -# Require YAML module -require 'yaml' - -gitlab_vagrant = YAML.load_file('gitlab-vagrant.yml') - -Vagrant.configure("2") do |config| - gitlab_vagrant.each do |gitlab_vagrant| - - name = gitlab_vagrant["name"] - version = gitlab_vagrant["version"] - edition = gitlab_vagrant["edition"] - host_port = gitlab_vagrant["host_port"] - - config.vm.define name do |provision| - config.vm.box = "ubuntu/xenial64" - config.vm.network "forwarded_port", guest: 80, host: host_port, - auto_correct: true - config.vm.provider "virtualbox" do |vb| - vb.memory = "4096" - end - - config.vm.provision "shell", inline: <<-SHELL - sudo DEBIAN_FRONTEND=noninteractive apt-get install curl openssh-server ca-certificates postfix - curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-#{edition}/script.deb.sh | sudo bash - sudo apt-get install gitlab-#{edition}=#{version}-#{edition}.0 - sudo gitlab-ctl reconfigure - SHELL - end - end -end diff --git a/app/init b/app/init new file mode 100755 index 0000000000000000000000000000000000000000..3a543d35bd0e3f54f8cbe972f1ce54f98c8045dd --- /dev/null +++ b/app/init @@ -0,0 +1,17 @@ +#!/bin/bash + +base_url=https://packages.gitlab.com/install/repositories/gitlab/gitlab- + +if [[ -z "$EDITION" || -z "$VERSION" ]]; then + cat << EOF +ERROR: must set EDITION and VERSION. + EDITION can be "ce" or "ee" + VERSION might be 9.1.2 +EOF + exit 1 +fi + +curl -s $base_url$EDITION/script.deb.sh | bash +apt-get install gitlab-${EDITION}=${VERSION}-${EDITION}.0 +gitlab-ctl reconfigure +exec bash