Advertisement
42n4

DOCKER4ALL

Apr 18th, 2017
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.14 KB | None | 0 0
  1. #curl https://pastebin.com/raw/xYGzrccq | sed 's/\r//g' > VAdocker4all.txt
  2. ##################################################################################
  3. ##################################################################################
  4. ## DOCKER ########################################################################
  5. ##################################################################################
  6. ##################################################################################
  7. #https://docs.docker.com/machine/drivers/virtualbox/
  8. systemctl enable docker
  9. systemctl start docker
  10. usermod -aG docker guest
  11.  
  12. #http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
  13. cat << 'EOF' >  test.S
  14. #include <sys/syscall.h>
  15. .text
  16. .globl _start
  17. .type _start, @function
  18. _start:
  19.         movq $SYS_exit, %rax
  20.         movq $0, %rdi
  21.         syscall
  22. EOF
  23. gcc -nostdlib test.S && { ./a.out; echo $?; }
  24.  
  25. [ ! -d hello ] && mkdir hello
  26. cd hello
  27. wget https://raw.githubusercontent.com/docker-library/hello-world/master/hello.c
  28. gcc -static -nostartfiles hello.c -o hello && { ./a.out; echo $?; }
  29. cat << 'EOF' > Dockerfile
  30. FROM scratch
  31. COPY hello /
  32. CMD ["/hello"]
  33. EOF
  34. docker build --rm -t dockhello .
  35. docker run --rm=true -v /sys/fs/cgroup:/sys/fs/cgroup:ro dockhello
  36. cd ..
  37.  
  38. [ ! -d witaj ] && mkdir witaj
  39. cd witaj
  40. #http://blog.bjdean.id.au/2015/08/docker-from-scratch/
  41. curl http://ix.io/pOz | sed 's/\r//g' > witaj.c
  42. echo -e "witaj: witaj.c" > makefile
  43. echo -e "\t gcc -static -o witaj witaj.c" >> makefile
  44. echo -e "docker: witaj" >> makefile
  45. echo -e "\t docker build --rm -t dockwitaj ." >> makefile
  46. cat << 'EOF' > Dockerfile
  47. FROM scratch
  48. COPY witaj /
  49. CMD ["/witaj"]
  50. EOF
  51. #gcc -static witaj.c -o witaj
  52. #docker build --rm -t dockwitaj .
  53. make docker
  54. #docker run --rm=true dockwitaj
  55. #/etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet systemd.legacy_systemd_cgroup_controller=yes"
  56. docker run --rm=true -v /sys/fs/cgroup:/sys/fs/cgroup:ro dockwitaj
  57. docker run --rm=true -v /sys/fs/cgroup:/sys/fs/cgroup:ro --env="BJDTEST=i żegna!"  dockwitaj
  58. cd ..
  59.  
  60. #https://www.iron.io/microcontainers-tiny-portable-containers/
  61.  
  62. #https://github.com/rocker-org/rocker
  63. docker run --rm=true -ti rocker/r-base
  64.  
  65. #https://github.com/pwasiewi/docker-freeciv
  66. docker run --rm -it openjdk:8
  67. docker run -it ubuntu:zesty /bin/bash
  68. docker rm -f `docker ps -aq` #usuń wszystkie docker kontenery
  69. docker run -d -v /freeciv:/freeciv -p 5556:5556 42n4/freeciv /freeciv/save.bz2
  70. docker ps -a
  71. docker exec -it objective_boyd /bin/bash
  72. #https://github.com/pwasiewi/docker-freeciv-client
  73. xhost +
  74. docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix 42n4/freeciv-client
  75.  
  76. #https://github.com/freeciv/freeciv-web
  77.  
  78. #http://blog.xebia.com/create-the-smallest-possible-docker-container/
  79. #https://www.linux.com/learn/how-use-docker-machine-create-swarm-cluster
  80. #https://opsnotice.xyz/how-to-monitor-docker-hosts/
  81. #https://docs.docker.com/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes
  82. #docker run -d --name='low_prio' --cpu-shares=250" --cpuset-cpus=0" busybox md5sum /dev/urandom
  83. #docker create -t -i fedora bash
  84. #docker start -a -i 6d8af538ec5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement