GithubHelp home page GithubHelp logo

laithshadeed / linode-stackscripts Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 16 KB

Unattended installation for linux server with Custom Kernel compilation to support latest Docker

Shell 100.00%
linode kernel linux ubuntu server docker stackscript bash xenial unattended-installation

linode-stackscripts's Introduction

Ubuntu 16.04 Server + Custom Kernel 4.9.12 + Docker 1.12

This script setup a fresh Ubuntu 16.04 server (Linode Image) with Custom Kernel compiled specially for Docker. It was hassle because you need special kernel modules to have a valid Docker installation.

Check your Kernel

To check the needed kernel modules run:

wget -q https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh -O - | bash

Create Stackscript in Linode

Create stackscript with Ubuntu 16.04 LTS & this script:

#!/bin/bash

#<UDF name="hostname" label="The hostname for the new Linode.">
# HOSTNAME=
#<UDF name="fqdn" label="The new Linode's Fully Qualified Domain Name">
# FQDN=
#<UDF name="sudo_user" Label="User with sudo" />
# SUDO_USER=
#<UDF name="sudo_user_pass" Label="Sudo user password" />
# SUDO_USER_PASS=
#<UDF name="sudo_user_pubkey" Label="Sudo user public key" />
# SUDO_USER_PUBKEY=

set -e
set -x

wget -q https://raw.githubusercontent.com/laithshadeed/linode-stackscripts/master/setup-docker-server.sh -O - | /bin/bash
touch /tmp/provisioned-successfully

You could also run directly inside your server shell:

HOSTNAME=your_host
FQDN=your_fqdn
SUDO_USER=your_user
SUDO_USER_PASS=your_pass
SUDO_USER_PUBKEY='your_pub_key'
wget -q https://raw.githubusercontent.com/laithshadeed/linode-stackscripts/master/setup-docker-server.sh -O - | /bin/bash

Create your Image

  • Create 'Linode 81920' (Yes I know, it is expensive, but will we just need it for 10-15 min ~ 1 $) Compiling the Kernal will talk long time. I suggest the following
  • Set profile label: 'Ubuntu 16.04-4.9.12 Docker 1.12.3'
  • Click 'Rebuild' with your Stackscript or with Ubuntu 16.04. Make sure to choose small disk size ~ 10GB
  • It will take 2-3 min to setup (including Kernel compilation). Rename the Disk to 'Ubuntu 16.04-4.9.12 Docker 1.12.3'
  • Go back and edit your profile. Now set 'Kernel' dropdown menu to 'Grub2' & Disable 'Network Helper'
  • Save & Reboot. Now your Linode should reboot into the newly compiled kernel, 4.9.12.
  • To verify. Login and run: uname -a. Confirm your docker is running: ps aux | grep docker
  • Now your disk is ready. Shutdown your Linode.
  • Go to your Disk. Click 'Create Image'
  • Now you can resize your linode to smaller size or delete it and create new one with that new image.
  • When you create new linode. You need to always choose 'Grub2' for kernel and your newly create disk or image.
  • Enjoy!

Check this page for some visual explanation.

Notes

  • This script is only tested with Ubuntu 16.04 + Upstream Kernel 4.9.12
    • Docker 1.12.3
  • You can try different version by modifying DOCKER_VERSION & KERNEL_VERSION in setup-docker-server.sh
  • The script do an apt-mark hold to freeze linux-image-generic, linux-headers-generic, grub-pc, console-setup, docker-engine versions from being upgraded.
  • It is not designed to run many times. It assumed to be run only one time.

TODO

linode-stackscripts's People

Contributors

laithshadeed avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.