Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
Minor osx shell fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Morgan <[email protected]>
  • Loading branch information
jmorganca committed Aug 11, 2015
1 parent d54a3cc commit 74a1fde
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion osx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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
ENV INSTALLER_VERSION 1.8.0-rc7
ENV INSTALLER_VERSION 1.8.0-rc8

ENV MIXPANEL_TOKEN c306ae65c33d7d09fe3e546f36493a6e

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ unset LD_LIBRARY_PATH

clear

machine=$($DOCKER_MACHINE ls -q | grep "^$VM$") || :
if [ -z $machine ]; then
/usr/local/bin/VBoxManage showvminfo $VM &> /dev/null
VM_EXISTS_CODE=$?

if [ $VM_EXISTS_CODE -ne 0 ]; then
echo "Creating Machine $VM..."
$DOCKER_MACHINE create -d virtualbox --virtualbox-memory 2048 $VM
$DOCKER_MACHINE rm -f $VM &> /dev/null
rm -rf ~/.docker/machine/machines/$VM
$DOCKER_MACHINE create -d virtualbox --virtualbox-memory 2048 $VM
else
echo "Machine $VM already exists."
fi
Expand Down
8 changes: 6 additions & 2 deletions osx/mpkg/boot2dockeriso.pkg/Scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ 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

# Clear out any existing VM data in case the user deleted the VM manually via VirtualBox
/usr/local/bin/docker-machine rm -f $VM &> /dev/null
rm -rf ~/.docker/machine/machines/$VM

# Run migration, opening logs if it fails
sudo -u $USER PATH=/Applications/VirtualBox.app/Contents/MacOS/:$PATH /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'
Expand Down

0 comments on commit 74a1fde

Please sign in to comment.