From de986d82afd962ae8bbc524948834dd1d164fff5 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sat, 8 Aug 2015 00:38:35 -0700 Subject: [PATCH] Bump RC versions; Unified script at end of installer --- osx/Dockerfile | 8 +- osx/mpkg/Distribution | 88 +++++++++---------- osx/mpkg/Resources/en.lproj/Installed.html | 2 +- .../boot2dockeriso.pkg/Scripts/postinstall | 40 +++++++++ osx/mpkg/dockermachine.pkg/PackageInfo | 3 - .../dockermachine.pkg/Scripts/postinstall | 33 ------- .../PackageInfo | 3 - .../Scripts/postinstall | 3 - 8 files changed, 85 insertions(+), 95 deletions(-) delete mode 100755 osx/mpkg/dockermachine.pkg/Scripts/postinstall delete mode 100755 osx/mpkg/dockerquickstartterminalapp.pkg/Scripts/postinstall diff --git a/osx/Dockerfile b/osx/Dockerfile index 34e3bc0ec4..5dca13f892 100644 --- a/osx/Dockerfile +++ b/osx/Dockerfile @@ -26,7 +26,7 @@ RUN curl -fsSL -o /vbox.dmg http://download.virtualbox.org/virtualbox/$VBOX_VERS # Download the Docker parts -ENV DOCKER_VERSION 1.8.0-rc2 +ENV DOCKER_VERSION 1.8.0-rc3 RUN curl -fsSL -o /docker https://test.docker.com/builds/Darwin/x86_64/docker-$DOCKER_VERSION RUN chmod +x /docker @@ -41,7 +41,7 @@ RUN chmod +x /docker-compose ENV BOOT2DOCKER_ISO_VERSION $DOCKER_VERSION RUN curl -fsSL -o /boot2docker.iso https://github.com/tianon/boot2docker-legacy/releases/download/v1.8.0-rc2/boot2docker.iso -ENV KITEMATIC_VERSION 0.8.0-rc4 +ENV KITEMATIC_VERSION 0.8.0-rc5 RUN curl -fsSL -o /kitematic.zip https://github.com/kitematic/kitematic/releases/download/v$KITEMATIC_VERSION/Kitematic-$KITEMATIC_VERSION-Mac.zip # ENV INSTALLER_VERSION $DOCKER_VERSION @@ -91,8 +91,6 @@ RUN cd /mpkg/docker.pkg && \ # dockermachine.pkg RUN cd /mpkg/dockermachine.pkg && \ - cd Scripts && find . | cpio -o --format odc | gzip -c > ../Scripts.bin && cd .. && \ - rm -r Scripts && mv Scripts.bin Scripts && \ mkdir rootfs && \ cd rootfs && \ mkdir -p usr/local/bin && \ @@ -148,8 +146,6 @@ RUN cd /mpkg/boot2dockeriso.pkg && \ # dockerquickstartterminalapp.pkg RUN cd /mpkg/dockerquickstartterminalapp.pkg && \ - cd Scripts && find . | cpio -o --format odc | gzip -c > ../Scripts.bin && cd .. && \ - rm -r Scripts && mv Scripts.bin Scripts && \ mkdir ./rootfs && \ cd ./rootfs && \ mv /mpkg/Docker\ Quickstart\ Terminal.app . && \ diff --git a/osx/mpkg/Distribution b/osx/mpkg/Distribution index 6aaab65b6b..25d058ba1e 100644 --- a/osx/mpkg/Distribution +++ b/osx/mpkg/Distribution @@ -21,9 +21,6 @@ - - - @@ -35,6 +32,41 @@ + #kitematicapp.pkg + + + + + #VBoxKEXTs.pkg + #VirtualBox.pkg + #VirtualBoxCLI.pkg + + + + + + + + + + + + + + + + + + + + + #boot2dockeriso.pkg + + + + + + #dockerquickstartterminalapp.pkg @@ -43,6 +75,13 @@ + + + + #dockermachine.pkg + + + @@ -124,47 +163,4 @@ /* js:pkmk:end */ ]]> - - #VBoxKEXTs.pkg - #VirtualBox.pkg - #VirtualBoxCLI.pkg - - - - - - - - - - - - - - - - - - - - - #boot2dockeriso.pkg - - - - #dockerquickstartterminalapp.pkg - - - - #kitematicapp.pkg - - - - - - - #dockermachine.pkg - - - diff --git a/osx/mpkg/Resources/en.lproj/Installed.html b/osx/mpkg/Resources/en.lproj/Installed.html index 96086e5bc6..e795029a95 100644 --- a/osx/mpkg/Resources/en.lproj/Installed.html +++ b/osx/mpkg/Resources/en.lproj/Installed.html @@ -7,7 +7,7 @@

Quick-Start

    -
  1. Start Launchpad.
  2. +
  3. Start Launchpad or open /Applications/Docker.
  4. Open the Docker Quickstart Terminal App.
  5. At the command line, test your installation by entering:
    docker run hello-world
  6. Visit the Docker OS X installation to learn more about your new installation.
  7. diff --git a/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall b/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall index b755fdb87a..cd694c9c20 100755 --- a/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall +++ b/osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall @@ -5,5 +5,45 @@ mkdir -p ~/.docker/machine/cache cp /usr/local/share/boot2docker/boot2docker.iso ~/.docker/machine/cache/boot2docker.iso chown -R $USER:staff ~/.docker +# Fix permissions on binaries +chown -R $USER:admin /usr/local/bin/docker +chown -R $USER:admin /usr/local/bin/docker-machine +chown -R $USER:admin /usr/local/bin/docker-compose + +# Migrate Boot2Docker VM +BOOT2DOCKER_VM=boot2docker-vm +VM=default + +sudo -u $USER /usr/local/bin/VBoxManage showvminfo $BOOT2DOCKER_VM &> /dev/null +BOOT2DOCKER_VM_EXISTS_CODE=$? + +sudo -u $USER /usr/local/bin/VBoxManage showvminfo $VM &> /dev/null +VM_EXISTS_CODE=$? + +# Exit if there's no boot2docker vm, or the destination VM already exists +if [ $BOOT2DOCKER_VM_EXISTS_CODE -eq 0 ] && [ $VM_EXISTS_CODE -ne 0 ]; then + + # Prompt the user to migrate + osascript -e 'tell app "System Events" to display dialog "Migrate your existing Boot2Docker VM to work with the Docker Toolbox?\n \nYour existing Boot2Docker VM will not be affected. This should take about a minute." buttons {"Do not Migrate", "Migrate"} default button 2 cancel button 1 with icon 2 with title "Migrate Boot2Docker VM?"' + if [ $? -eq 0 ]; then + rm -rf ~/.docker/machine/machines/default + sudo -u $USER PATH=/Applications/VirtualBox.app/Contents/MacOS/:$PATH bash -c "/usr/local/bin/docker-machine -D create -d virtualbox --virtualbox-import-boot2docker-vm $BOOT2DOCKER_VM $VM" 2>&1 | sed -e '/BEGIN/,/END/d' > /tmp/toolbox-migration-logs.txt + if [ $? -eq 0 ]; then + osascript -e 'tell app "System Events" to display dialog "Boot2Docker VM migrated successfully to a Docker Machine VM named \"default\"" buttons {"Ok"} default button 1' + else + osascript -e 'tell app "System Events" to display dialog "Could not migrate the Boot2Docker VM. Please file an issue with the migration logs at https://github.com/docker/machine/issues/new." buttons {"Cancel", "View Migration Logs"} default button 2 cancel button 1 with icon 0 with title "Migration Failed"' + if [ $? -eq 0 ]; then + open -a TextEdit /tmp/toolbox-migration-logs.txt + fi + exit 1 + fi + fi +fi + +# Open Applications dir if it exists and is not empty +if [ -d /Applications/Docker ] && [ "$(ls -A /Applications/Docker)" ]; then + open /Applications/Docker +fi + curl -H "Content-Type: application/json" -X POST "https://api.mixpanel.com/track/?data=%EVENT_DATA%" diff --git a/osx/mpkg/dockermachine.pkg/PackageInfo b/osx/mpkg/dockermachine.pkg/PackageInfo index b62b6cb3ac..69da875e9b 100644 --- a/osx/mpkg/dockermachine.pkg/PackageInfo +++ b/osx/mpkg/dockermachine.pkg/PackageInfo @@ -7,7 +7,4 @@ - - - diff --git a/osx/mpkg/dockermachine.pkg/Scripts/postinstall b/osx/mpkg/dockermachine.pkg/Scripts/postinstall deleted file mode 100755 index ab1c8d75ee..0000000000 --- a/osx/mpkg/dockermachine.pkg/Scripts/postinstall +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -ls -al ~/.docker/machine/cache/ - -# Migrate Boot2Docker VM -BOOT2DOCKER_VM=boot2docker-vm -VM=default - -sudo -u $USER /usr/local/bin/VBoxManage showvminfo $BOOT2DOCKER_VM &> /dev/null -BOOT2DOCKER_VM_EXISTS_CODE=$? - -sudo -u $USER /usr/local/bin/VBoxManage showvminfo $VM &> /dev/null -VM_EXISTS_CODE=$? - -# Exit if there's no boot2docker vm, or the destination VM already exists -if [ $BOOT2DOCKER_VM_EXISTS_CODE -ne 0 ] || [ $VM_EXISTS_CODE -eq 0 ]; then - exit 0 -fi - -osascript -e 'tell app "System Events" to display dialog "Migrate your existing Boot2Docker VM to work with the Docker Toolbox?\n \nYour existing Boot2Docker VM will not be affected. This should take about a minute." buttons {"Do not Migrate", "Migrate"} default button 2 cancel button 1 with icon 2 with title "Migrate Boot2Docker VM?"' -if [ $? -eq 0 ]; then - rm -rf ~/.docker/machine/machines/default - sudo -u $USER PATH=/Applications/VirtualBox.app/Contents/MacOS/:$PATH bash -c "/usr/local/bin/docker-machine -D create -d virtualbox --virtualbox-import-boot2docker-vm $BOOT2DOCKER_VM $VM" 2>&1 | sed -e '/BEGIN/,/END/d' > /tmp/toolbox-migration-logs.txt - if [ $? -ne 0 ]; then - osascript -e 'tell app "System Events" to display dialog "Boot2Docker VM migrated successfully to a Docker Machine VM named \"default\"" buttons {"Ok"} default button 1' - else - osascript -e 'tell app "System Events" to display dialog "Could not migrate the Boot2Docker VM. Please file an issue with the migration logs at https://github.com/docker/machine/issues/new." buttons {"Cancel", "View Migration Logs"} default button 2 cancel button 1 with icon 0 with title "Migration Failed"' - if [ $? -eq 0 ]; then - open -a TextEdit /tmp/toolbox-migration-logs.txt - fi - exit 1 - fi -fi diff --git a/osx/mpkg/dockerquickstartterminalapp.pkg/PackageInfo b/osx/mpkg/dockerquickstartterminalapp.pkg/PackageInfo index fb97e8af04..d3ed52b1e0 100644 --- a/osx/mpkg/dockerquickstartterminalapp.pkg/PackageInfo +++ b/osx/mpkg/dockerquickstartterminalapp.pkg/PackageInfo @@ -7,7 +7,4 @@ - - - diff --git a/osx/mpkg/dockerquickstartterminalapp.pkg/Scripts/postinstall b/osx/mpkg/dockerquickstartterminalapp.pkg/Scripts/postinstall deleted file mode 100755 index fb072e1b20..0000000000 --- a/osx/mpkg/dockerquickstartterminalapp.pkg/Scripts/postinstall +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -open /Applications/Docker/