diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..1521c8b765 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +dist diff --git a/.gitignore b/.gitignore index 4f6f8cd73f..1521c8b765 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -DockerToolbox*.pkg -windows/Output/** -windows/bundle/** +dist diff --git a/osx/Dockerfile b/Dockerfile.osx similarity index 99% rename from osx/Dockerfile rename to Dockerfile.osx index eb92d8552b..50df9031a2 100644 --- a/osx/Dockerfile +++ b/Dockerfile.osx @@ -50,7 +50,7 @@ ENV MIXPANEL_TOKEN c306ae65c33d7d09fe3e546f36493a6e # Start building package -COPY mpkg /mpkg +COPY osx/mpkg /mpkg # Extract the VirtualBox .pkg RUN mkdir -p /mpkg/vbox && \ diff --git a/Dockerfile.windows b/Dockerfile.windows new file mode 100644 index 0000000000..9bd75135a8 --- /dev/null +++ b/Dockerfile.windows @@ -0,0 +1,54 @@ +FROM debian:jessie + +ENV DEBIAN_FRONTEND noninteractive + +RUN dpkg --add-architecture i386 +RUN sed -i "s/main/main contrib non-free/" etc/apt/sources.list +RUN apt-get update && apt-get install -yq wine curl unrar unzip + +# innosetup +RUN mkdir innosetup && \ + cd innosetup && \ + curl -fsSL -o innounp043.rar "https://downloads.sourceforge.net/project/innounp/innounp/innounp%200.43/innounp043.rar?r=&ts=1439566551&use_mirror=skylineservers" && \ + unrar e innounp043.rar + +RUN cd innosetup && \ + curl -fsSL -o is-unicode.exe http://www.jrsoftware.org/download.php/is-unicode.exe && \ + wine "./innounp.exe" -e "is-unicode.exe" + +# installer components +ENV INSTALLER_VERSION 1.8.1a +ENV DOCKER_VERSION 1.8.1 +ENV DOCKER_MACHINE_VERSION 0.4.0 +ENV BOOT2DOCKER_ISO_VERSION $DOCKER_VERSION +ENV KITEMATIC_VERSION 0.8.2 +ENV VIRTUALBOX_VERSION 5.0.0 +ENV VIRTUALBOX_REVISION 101573 +ENV MSYSGIT_VERSION 1.9.5-preview20150319 + +RUN mkdir /bundle +WORKDIR /bundle +RUN curl -fsSL -o docker.exe "https://get.docker.com/builds/Windows/x86_64/docker-$DOCKER_VERSION.exe" +RUN curl -fsSL -o docker-machine.exe "https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine_windows-amd64.exe" +RUN curl -fsSL -o boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v$BOOT2DOCKER_ISO_VERSION/boot2docker.iso +RUN curl -fsSL -o kitematic.zip "https://github.com/kitematic/kitematic/releases/download/v$KITEMATIC_VERSION/Kitematic-$KITEMATIC_VERSION-Windows-Alpha.zip" && \ + mkdir kitematic && \ + cd kitematic && \ + unzip ../kitematic.zip && \ + rm ../kitematic.zip +RUN curl -fsSL -o Git.exe "https://github.com/msysgit/msysgit/releases/download/Git-$MSYSGIT_VERSION/Git-$MSYSGIT_VERSION.exe" +RUN curl -fsSL -o virtualbox.exe "http://download.virtualbox.org/virtualbox/$VIRTUALBOX_VERSION/VirtualBox-$VIRTUALBOX_VERSION-$VIRTUALBOX_REVISION-Win.exe" +RUN wine virtualbox.exe -extract -silent -path . && \ + rm virtualbox.exe && \ + rm *x86.msi && \ + mv *_amd64.msi VirtualBox_amd64.msi + +RUN echo "{\"event\":\"Installer Finished\",\"properties\":{\"token\":\"$MIXPANEL_TOKEN\",\"version\":\"$INSTALLER_VERSION\",\"os\":\"darwin\"}}" | base64 | tr -d '\n' > started.txt +RUN echo "{\"event\":\"Installer Finished\",\"properties\":{\"token\":\"$MIXPANEL_TOKEN\",\"version\":\"$INSTALLER_VERSION\",\"os\":\"darwin\"}}" | base64 | tr -d '\n' > finished.txt + +# Add installer resources +COPY windows /installer + +WORKDIR /installer +RUN rm -rf /tmp/.wine-0/ +RUN wine ../innosetup/ISCC.exe Toolbox.iss /DMyAppVersion=$INSTALLER_VERSION diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..9293d56ba8 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +DOCKER_OSX_IMAGE := osx-installer +DOCKER_WINDOWS_IMAGE := windows-installer +DOCKER_OSX_CONTAINER := build-osx-installer +DOCKER_WINDOWS_CONTAINER := build-windows-installer + +default: osx windows + @true + +osx: clean-osx + docker build -t $(DOCKER_OSX_IMAGE) -f Dockerfile.osx . + docker run --name "$(DOCKER_OSX_CONTAINER)" "$(DOCKER_OSX_IMAGE)" + docker cp "$(DOCKER_OSX_CONTAINER)":/DockerToolbox.pkg dist/ + docker rm "$(DOCKER_OSX_CONTAINER)" 2>/dev/null || true + +windows: clean-windows + docker build -t $(DOCKER_WINDOWS_IMAGE) -f Dockerfile.windows . + docker run --name "$(DOCKER_WINDOWS_CONTAINER)" "$(DOCKER_WINDOWS_IMAGE)" + docker cp "$(DOCKER_WINDOWS_CONTAINER)":/installer/Output/DockerToolbox.exe dist/ + docker rm "$(DOCKER_WINDOWS_CONTAINER)" 2>/dev/null || true + +clean-osx: + rm -f DockerToolbox-*.pkg + docker rm "$(DOCKER_OSX_CONTAINER)" 2>/dev/null || true + +clean-windows: + rm -f DockerToolbox-*.exe + docker rm "$(DOCKER_WINDOWS_CONTAINER)" 2>/dev/null || true diff --git a/osx/Makefile b/osx/Makefile deleted file mode 100644 index 813ebd639e..0000000000 --- a/osx/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -DOCKER_IMAGE := osx-installer -DOCKER_CONTAINER := build-osx-installer - -default: dockerbuild - @true - -dockerbuild: clean - docker build -t $(DOCKER_IMAGE) . - docker run --name "$(DOCKER_CONTAINER)" "$(DOCKER_IMAGE)" - docker cp "$(DOCKER_CONTAINER)":/DockerToolbox.pkg . - docker rm "$(DOCKER_CONTAINER)" 2>/dev/null || true - -clean: - rm -f DockerToolbox.pkg - docker rm "$(DOCKER_CONTAINER)" 2>/dev/null || true - diff --git a/osx/README.md b/osx/README.md deleted file mode 100644 index d883c4bf32..0000000000 --- a/osx/README.md +++ /dev/null @@ -1,7 +0,0 @@ -#Docker Toolbox for Mac OS X - -Installation [instructions](https://docs.docker.com/mac/started/) available on the Docker documentation site. - -##How to build - -Running `make` will produce a `DockerToolbox.pkg` installer. diff --git a/windows/README.md b/windows/README.md deleted file mode 100644 index cf5ff40c5a..0000000000 --- a/windows/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Building the Windows Toolbox - -1. Install Inno Setup 5 non-unicode: http://www.jrsoftware.org/isdl.php (`isetup-5.x.x-unicode.exe`). - -2. Install `kSignCMD`: http://codesigning.ksoftware.net/ (click "Download kSign" -and then "FREE DOWNLOAD" or "Click Here to Download kSign", which will likely be -a link to http://cdn1.ksoftware.net/ksign_installer.exe) - -3. Install the `docker-code-signing.pfx` certificate somewhere (the instructions -below assume `Z:\sven\src\docker\windows-installer\docker-code-signing.pfx`); -you will need the password (`d_get_from_core` below). - -4. Open `Toolbox.iss` in the Inno Setup Compiler. It has a few constants at -the top that are important to make note of (especially `MyAppVersion` and the -path variables `dockerCli`, `dockerMachineCli`, `kitematicSetup`, `b2dIso`, `msysGit`, `virtualBoxMsi`, and `virtualBoxCommon`). - -5. Launch **Inno Setup Compiler** by opening `Toolbox.iss` and add code signing -by applying the following steps: - -- Click "Tools" --> "Configure Sign Tools" > "Add" -- "Name of the Sign Tool:" `ksign` -- "Command of the Sign Tool:" `"C:\Program Files (x86)\kSign\kSignCMD.exe" /f Z:\sven\src\docker\toolbox\docker-code-signing.pfx /p d_get_from_core $p` - -# Releasing a new version - -Update the versions of the dependencies in `bundle.sh`. - -Update `#define MyAppVersion` line in `Toolbox.iss`. - -# Downloading bundle dependencies - -Open a git bash window in this directory and run script: - - ./bundle.sh - -This should be downloading dependencies with their correct versions to `bundle\` -folder where the Inno Setup Compiler can pick up from. - -# Compiling the installer - -After configuring, open `Toolbox.iss` with Inno Setup Compiler and hit -**'Build'**. The results will be in the `Output` folder. - -This can be done through commandline as welll. Launch a cmd.exe shell from this -directory and run: - - "c:\Program Files (x86)\Inno Setup 5\ISCC.exe" Toolbox.iss diff --git a/windows/Toolbox.iss b/windows/Toolbox.iss index 40d2a43113..a16ea838bc 100644 --- a/windows/Toolbox.iss +++ b/windows/Toolbox.iss @@ -2,39 +2,38 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Docker Toolbox" -#define MyAppVersion "1.8.1a" #define MyAppPublisher "Docker" #define MyAppURL "https://docker.com" #define MyAppContact "https://docs.docker.com" -#define b2dIsoPath ".\bundle\Boot2Docker\boot2docker.iso" +#define b2dIsoPath "..\bundle\boot2docker.iso" -#define dockerCli ".\bundle\docker\docker.exe" -#define dockerMachineCli ".\bundle\docker\docker-machine.exe" +#define dockerCli "..\bundle\docker.exe" +#define dockerMachineCli "..\bundle\docker-machine.exe" -#define kitematic ".\bundle\kitematic" +#define kitematic "..\bundle\kitematic" -#define msysGit ".\bundle\msysGit\Git.exe" +#define msysGit "..\bundle\Git.exe" -#define virtualBoxCommon ".\bundle\VirtualBox\common.cab" -#define virtualBoxMsi ".\bundle\VirtualBox\VirtualBox_amd64.msi" +#define virtualBoxCommon "..\bundle\common.cab" +#define virtualBoxMsi "..\bundle\VirtualBox_amd64.msi" -#define EventStartedFile FileOpen(".\bundle\started.txt") +#define EventStartedFile FileOpen("..\bundle\started.txt") #define EventStartedData = FileRead(EventStartedFile) #expr FileClose(EventStartedFile) #undef EventStartedFile -#define EventFinishedFile FileOpen(".\bundle\finished.txt") +#define EventFinishedFile FileOpen("..\bundle\finished.txt") #define EventFinishedData = FileRead(EventFinishedFile) #expr FileClose(EventFinishedFile) -#undef EventFinishedFile +#undef EventFinishedFile [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{FC4417F0-D7F3-48DB-BCE1-F5ED5BAFFD91} AppCopyright={#MyAppPublisher} +AppId={{FC4417F0-D7F3-48DB-BCE1-F5ED5BAFFD91} AppContact={#MyAppContact} AppComments={#MyAppURL} AppName={#MyAppName} @@ -53,7 +52,7 @@ DisableProgramGroupPage=yes ;InfoBeforeFile=.\LICENSE ;DisableFinishedPage ;InfoAfterFile= -OutputBaseFilename=DockerToolbox-{#MyAppVersion} +OutputBaseFilename=DockerToolbox Compression=lzma SolidCompression=yes WizardImageFile=windows-installer-side.bmp @@ -66,7 +65,7 @@ WizardImageBackColor=$22EBB8 ; in the "Add/Remove" list: UninstallDisplayIcon={app}\unins000.exe -SignTool=ksign /d $q{#MyAppName}$q /du $q{#MyAppURL}$q $f +; SignTool=ksign /d $q{#MyAppName}$q /du $q{#MyAppURL}$q $f SetupIconFile=toolbox.ico @@ -393,4 +392,4 @@ begin end; end; end -end; \ No newline at end of file +end; diff --git a/windows/bundle.sh b/windows/bundle.sh deleted file mode 100644 index 7e0769e16d..0000000000 --- a/windows/bundle.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -set -e - -# Script to grab binaries that are going to be bundled with windows installer. -# Note to maintainers: Update versions used below with newer releases - -docker=1.8.1 -dockerMachine=0.4.0 -kitematic=0.8.2 -vbox=5.0.0 -vboxRev=101573 -msysGit=1.9.5-preview20150319 -installer=1.8.1a -mixpanel=c306ae65c33d7d09fe3e546f36493a6e - -boot2dockerIsoSrc=boot2docker -dockerBucket=get.docker.com - -set -x -rm -rf bundle -mkdir bundle -cd bundle - -echo "{\"event\":\"Installer Started\",\"properties\":{\"token\":\"$mixpanel\",\"version\":\"$installer\",\"os\":\"win32\"}}" > out.txt -certutil -encode out.txt started-cert.txt -cat started-cert.txt | sed '/^-----/ d' | tr -d '\n' > started.txt -rm started-cert.txt - -echo "{\"event\":\"Installer Finished\",\"properties\":{\"token\":\"$mixpanel\",\"version\":\"$installer\",\"os\":\"win32\"}}" > out.txt -certutil -encode out.txt finished-cert.txt -cat finished-cert.txt | sed '/^-----/ d' | tr -d '\n' > finished.txt -rm finished-cert.txt - -( - mkdir -p docker - cd docker - - curl -fsSL -o docker.exe "https://${dockerBucket}/builds/Windows/x86_64/docker-${docker}.exe" - curl -fsSL -o docker-machine.exe "https://github.com/docker/machine/releases/download/v${dockerMachine}/docker-machine_windows-amd64.exe" -) - -( - mkdir -p kitematic - curl -fsSL -o kitematic.zip "https://github.com/kitematic/kitematic/releases/download/v${kitematic}/Kitematic-${kitematic}-Windows-Alpha.zip" - cd kitematic - unzip ../kitematic.zip - rm ../kitematic.zip -) - -( - mkdir -p Boot2Docker - cd Boot2Docker - - curl -fsSL -o boot2docker.iso "https://github.com/${boot2dockerIsoSrc}/boot2docker/releases/download/v${docker}/boot2docker.iso" -) - -( - mkdir -p msysGit - cd msysGit - - curl -fsSL -o Git.exe "https://github.com/msysgit/msysgit/releases/download/Git-${msysGit}/Git-${msysGit}.exe" -) - -( - mkdir -p VirtualBox - cd VirtualBox - - # http://www.virtualbox.org/manual/ch02.html - curl -fsSL -o virtualbox.exe "http://download.virtualbox.org/virtualbox/${vbox}/VirtualBox-${vbox}-${vboxRev}-Win.exe" - - virtualbox.exe -extract -silent -path . - rm virtualbox.exe # not neeeded after extraction - - rm *x86.msi # not needed as we only install 64-bit - mv *_amd64.msi VirtualBox_amd64.msi # remove version number -) diff --git a/windows/windows-installer-logo.bmp b/windows/windows-installer-logo.bmp old mode 100644 new mode 100755 index 75f96bf02a..f77712c990 Binary files a/windows/windows-installer-logo.bmp and b/windows/windows-installer-logo.bmp differ diff --git a/windows/windows-installer-side.bmp b/windows/windows-installer-side.bmp old mode 100644 new mode 100755 index 324dfa56e5..c2074f02ea Binary files a/windows/windows-installer-side.bmp and b/windows/windows-installer-side.bmp differ