Search This Blog

Showing posts with label installer. Show all posts
Showing posts with label installer. Show all posts

Friday, September 19, 2014

Just Install Docker on Ubuntu 14.04 64-bit...

It has been a while since I have posted, so I'm making this one short.  Ever want a clean and concise script written in Bash that will install the latest version of Docker (And stay up to date)?  Well, here. Note that Docker wants you to pick the DNS.  So I've used 8.8.8.8 (Google-DNS) for this example.

Note: This will also install the kernal extras to enable AUFS support.
#!/bin/bash
#Update our local package index
sudo apt-get update
#Make sure Apt supports HTTPS
[ -e /usr/lib/apt/methods/https ] || {
  apt-get install -y apt-transport-https
}
# Get server key for repo
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# Update Repo Sources...
[ -e /etc/apt/sources.list.d/docker.list ] || {
  rm /etc/apt/sources.list.d/docker.list
}
sudo echo "deb https://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
sudo apt-get update
# ensure  Linux kernel extra modules are installed which support cpu cgroups, etc...
sudo apt-get install -y linux-image-extra-$(uname -r)
# install docker
sudo apt-get install -y lxc-docker
# update docker DNS and listen on localhost tcp
sudo echo 'DOCKER_OPTS="-dns 8.8.8.8 -H unix:///var/run/docker.sock -H tcp://127.0.0.1:5555"' > /etc/default/docker

Monday, October 10, 2011

NSIS - nullsoft scriptable install system 2.46



Recently I was tasked with automating the installation of a few customized applications. As a requirement for my production site, I must always have the most up to date version of the following:
  • Apache Web Server (HTTPD) 2.2.21
  • OpenSSL 1.0.0e
  • PHP 5.3.8
  • Java Runtime 1.6
  • ElasticSearch 0.17.1
  • Databases supported MySQL, Oracle, MS-SQL Server (various php extensions needed)
  • Custom PHP Web Application w/ ExtJS 4.0.6
Maintaining the updates for these products can be a pain when you do not have access to the production system. My original Install guide was quite lengthly and was a pain to keep up to date everytime my installation procedures changed. I was able to fix all of this will Nullsoft's NSIS.

There are a variety of plugins available to help with different tasks. Currently my Installer uses a splash screen, modifys system variables, creates and starts windows services, and uninstalls everything cleanly.
Splash Screen - Just Modify the Splash.bmp's Absolute path in quotes. Add to the NSI file just before you Installer Information. (Name, Outfile, installDir, etc.)
;====================================================
;Splash Screen Information

Function .onInit
SetOutPath $TEMP
File /oname=spltmp.bmp "C:\Users\Charles\Desktop\Splash.bmp"
advsplash::show 1000 600 400 -1 $TEMP\spltmp
Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.
Delete $TEMP\spltmp.bmp
FunctionEnd
If you want your installer to run with elevated Privledges (Vista, Windows 7)
;====================================================
;Elevate Privs for Installation
RequestExecutionLevel admin
Check Java Version
;====================================================
;Java Installation Check
Section "find java" FINDJAVA

StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"
StrCpy $2 0
ReadRegStr $2 HKLM "$1" "CurrentVersion"
StrCmp $2 "" DetectTry2
ReadRegStr $5 HKLM "$1\$2" "JavaHome"
StrCmp $5 "" DetectTry2
goto done

DetectTry2:
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"
StrCmp $2 "" NoJava
ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"
StrCMP $5 "" NoJava done

done:
;All done.

NoJava:
;Install Java script
nsExec::Exec "start http:\\www.java.com"
SectionEnd

Check the nullsoft site for downloads and additional information. I used the nsSCM & nsEXEC plugins for manipulation of window's services and other batch script tasks.