This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
set -e | |
# install via curl | |
# curl -sL https://gist.github.com/chasebolt/fd5210b4c2a44a2b0db383162a66632c/raw/install_eon_purge_data.sh | bash | |
# create purge script | |
mkdir -p /data/local | |
cat <<'EOF' > /data/local/purge-data.sh | |
#!/bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker run -v '/home:/home:ro' -it alpine /bin/sh | |
{ | |
"Hostname": "", | |
"Domainname": "", | |
"User": "", | |
"AttachStdin": true, | |
"AttachStdout": true, | |
"AttachStderr": true, | |
"Tty": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker run -v '/home' -it alpine /bin/sh` | |
{ | |
"Hostname": "", | |
"Domainname": "", | |
"User": "", | |
"AttachStdin": true, | |
"AttachStdout": true, | |
"AttachStderr": true, | |
"Tty": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mv /var/run/docker.sock /var/run/docker.sock.orig \ | |
&& socat -v UNIX-LISTEN:/var/run/docker.sock,group=docker,perm=0660,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock.orig; \ | |
mv /var/run/docker.sock.orig /var/run/docker.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ chef-docker git:(ports) ✗ kitchen converge resources-183-ubuntu-1504 | |
-----> Starting Kitchen (v1.4.2) | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/webagent-cookie.rb:458: warning: already initialized constant HTTPClient::CookieManager | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/cookie.rb:8: warning: previous definition of CookieManager was here | |
-----> Converging <resources-183-ubuntu-1504>... | |
Preparing files for transfer | |
Preparing dna.json | |
Resolving cookbook dependencies with Berkshelf 4.0.1... | |
Removing non-cookbook files before transfer | |
Preparing validation.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ chef-docker git:(ports) ✗ kitchen converge resources-183-ubuntu-1504 | |
-----> Starting Kitchen (v1.4.2) | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/webagent-cookie.rb:458: warning: already initialized constant HTTPClient::CookieManager | |
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/cookie.rb:8: warning: previous definition of CookieManager was here | |
-----> Converging <resources-183-ubuntu-1504>... | |
Preparing files for transfer | |
Preparing dna.json | |
Resolving cookbook dependencies with Berkshelf 4.0.1... | |
Removing non-cookbook files before transfer | |
Preparing validation.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chef 12.4.3: | |
{ | |
:name=>"/hammer", | |
:noop=>nil, | |
:before=>nil, | |
:params=>{}, | |
:provider=>nil, | |
:allowed_actions=>[:nothing, | |
:create], | |
:action=>[:create], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if lvs ephemeral/data > /dev/null 2>&1; then | |
echo 'lvm already created; exiting' | |
exit 0 | |
fi | |
if ls /dev/xvd* > /dev/null 2>&1; then map='xvd'; fi | |
if ls /dev/sd* > /dev/null 2>&1; then map='sd'; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@resources-182-ubuntu-1504-chef-latest:~# docker run --name hammer_time -d busybox nc -ll -p 187 -e /bin/cat | |
70fbaeada1097170a3ef6274ae5e17ffea2ea8a02bc17f8f77092027e9c77e9a | |
root@resources-182-ubuntu-1504-chef-latest:~# docker exec hammer_time ps auxw | |
PID USER TIME COMMAND | |
1 root 0:00 nc -ll -p 187 -e /bin/cat | |
5 root 0:00 ps auxw | |
root@resources-182-ubuntu-1504-chef-latest:~# time docker stop hammer_time | |
real 0m10.540s | |
user 0m0.008s | |
sys 0m0.020s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case node.environment | |
when 'prod' | |
default['docker-containers'] = { | |
"cadvisor": { | |
"repo": "docker.io", | |
"image": "google/cadvisor", | |
"tag": "v1", | |
"port-8080": 8190 | |
} | |
} |
NewerOlder