Skip to content

Instantly share code, notes, and snippets.

CoreOS alpha (745.1.0)
core@kalimdor ~ $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bde18d705b86 sameersbn/gitlab:7.12.2-2 "/sbin/entrypoint.sh 6 days ago Up 26 seconds 443/tcp, 0.0.0.0:10022->22/tcp, 0.0.0.0:10080->80/tcp gitlab
42b5896ee45e registry:2 "registry cmd/regist 3 weeks ago Up 29 seconds 0.0.0.0:5000->5000/tcp registry
eb05cf6fd7ec redis:3 "/entrypoint.sh redi 5 weeks ago Exited (0) 4 weeks ago dev-redis
4bb6c15f0b1c sameersbn/redmine:2.6.1 "/app/init app:start 3 months ago Up 26 seconds 443/tcp, 0.0.0.0:11080->80/tcp redmine
67d683ac603d nginx:latest "nginx -g 'daemon
#This gist expects msys git installed in path ${env:ProgramFiles(x86)}\Git\
$title = "Create CoreOS Docker host for Hyper-V"
$message = "Are you sure you want to start the setup for CoreOS, please ensure msys git has been installed first?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
"Confirm msys git is installed and it is safe to proceed with setup."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
"Cancel setup."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$result = $host.ui.PromptForChoice($title, $message, $options, 0)
switch ($result)
@so0k
so0k / demo-env.sh
Last active August 29, 2015 14:07
demoapp Docker environment - python & nodejs command line interface containers
#!/bin/bash
#this is old, do not use, use docker-compose instead
#demoapp env management script
#based on andreagrandi/glowmachine sample
#this script assumes it is running in the project folder
#under the data directory created by this boot2docker setup script:
#https://gist.github.com/so0k/d4f5e485a81ca5768643
@so0k
so0k / Set-localdocker.bat
Created August 22, 2014 11:52
CMD Batch that gets the boot2docker ip and updates the host file - powershell can't handle boot2docker ip command... Depends on Update-Hosts / Add-Hosts powershell scripts
@ECHO OFF
ECHO Getting boot2docker ip...
FOR /f "usebackq tokens=*" %%a IN (`boot2docker ip`) DO SET localdocker-ip=%%a
ECHO %localdocker-ip%
ECHO.
ECHO Analyzing hosts file
%windir%\System32\FIND /C /I "localdocker" %windir%\System32\drivers\etc\hosts
IF %ERRORLEVEL% NEQ 0 (
ECHO localdocker not found, adding to hosts...
powershell -command "Add-Hosts.ps1 -hostName \"localdocker\" -hostIp \"%localdocker-ip%\""
@so0k
so0k / Build-DockerContainers.ps1
Last active July 7, 2016 11:15
Powershell script to synchronize Boot2docker data and rebuild containers (depends on gm-env.sh & build_containers.sh & Set-localdocker.bat) - also requires Posh-SSH to be installed prior to using this script
Param(
[switch]$keepalive
)
#region script config
$dockerhost = "localdocker"
$User = "docker"
$PWord = (new-object System.Security.SecureString) #this is how you define blank password
$keyfile = "C:\Path\To\keys"
#endregion
@so0k
so0k / Connect-Boot2Docker.ps1
Created August 21, 2014 22:42
open a boot2docker ssh console from powershell
#connect b2d ssh
start cmd -ArgumentList @('/C','boot2docker','ssh')
@so0k
so0k / syncG.bat
Created August 15, 2014 11:10
this file has been replaced by powershell script
@ECHO OFF
SET LOCAL_DATA_DIR=%CD%
SET REMOTE_SUB_DIR=golfconnect-docker
IF EXIST G:\%REMOTE_SUB_DIR% (
echo %REMOTE_SUB_DIR% exists - should prompt for clear
) ELSE (
mkdir G:\%REMOTE_SUB_DIR%
)
Param(
[Parameter(Mandatory=$true)]
[string]$hostName,
[Parameter(Mandatory=$true)]
[string]$hostIp
)
function IsAdministrator
{
$Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
Param(
[Parameter(Mandatory=$true)]
[string]$hostName,
[Parameter(Mandatory=$true)]
[string]$hostIp
)
function IsAdministrator
{
$Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
@so0k
so0k / mountG.bat
Last active August 29, 2015 14:05
mount g drive - depends Set-localdocker.bat
@ECHO OFF
Set-localdocker.bat
IF EXIST G: (
ECHO Removing existing G: mapping...
net use G: /d
)
ECHO Mapping G: to "\\localdocker\data" ...
NET USE G: \\localdocker\data