Advertisement
gusto2

docker references

Nov 29th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. install docker AmazonAMI (CentOS 6)
  2.  
  3. CentOS
  4. https://docs.docker.com/engine/installation/linux/centos/
  5.  
  6. sudo yum install -y yum-utils \
  7. device-mapper-persistent-data \
  8. lvm2
  9.  
  10. sudo yum-config-manager \
  11. --add-repo \
  12. https://download.docker.com/linux/centos/docker-ce.repo
  13.  
  14. sudo yum install docker-ce
  15.  
  16.  
  17. AMILinux
  18. http://www.bogotobogo.com/DevOps/Docker/Docker_Install_On_Amazon_Linux_AMI.php
  19. sudo service docker start
  20. sudo service docker status
  21.  
  22. attach Attach to a running container
  23. build Build an image from a Dockerfile
  24. commit Create a new image from a container's changes
  25. cp Copy files/folders between a container and the local filesystem
  26. create Create a new container
  27. diff Inspect changes on a container's filesystem
  28. events Get real time events from the server
  29. exec Run a command in a running container
  30. export Export a container's filesystem as a tar archive
  31. history Show the history of an image
  32. images List images
  33. import Import the contents from a tarball to create a filesystem image
  34. info Display system-wide information
  35. inspect Return low-level information on a container or image
  36. kill Kill a running container
  37. load Load an image from a tar archive or STDIN
  38. login Log in to a Docker registry
  39. logout Log out from a Docker registry
  40. logs Fetch the logs of a container
  41. network Manage Docker networks
  42. pause Pause all processes within a container
  43. port List port mappings or a specific mapping for the CONTAINER
  44. ps List containers
  45. pull Pull an image or a repository from a registry
  46. push Push an image or a repository to a registry
  47. rename Rename a container
  48. restart Restart a container
  49. rm Remove one or more containers
  50. rmi Remove one or more images
  51. run Run a command in a new container
  52. save Save one or more images to a tar archive
  53. search Search the Docker Hub for images
  54. start Start one or more stopped containers
  55. stats Display a live stream of container(s) resource usage statistics
  56. stop Stop a running container
  57. tag Tag an image into a repository
  58. top Display the running processes of a container
  59. unpause Unpause all processes within a container
  60. update Update configuration of one or more containers
  61. version Show the Docker version information
  62. volume Manage Docker volumes
  63. wait Block until a container stops, then print its exit code
  64.  
  65.  
  66. sudo usermod -aG docker {username}
  67. docker pull centos
  68. docker run centos
  69.  
  70. sudo docker images
  71.  
  72. # shel into the instance
  73. docker run -it centos
  74.  
  75. sudo docker run centos yum install -y java-1.8.0-openjdk-headless
  76. sudo docker commit -m "java installation" -a "Gabriel" 04b5b89274ce test/centos_java
  77.  
  78. https://docs.docker.com/engine/reference/builder/
  79.  
  80.  
  81.  
  82. sudo docker images
  83.  
  84. # shel into the instance
  85. docker run -it centos
  86.  
  87. sudo docker run centos yum install -y java-1.8.0-openjdk-headless
  88. sudo docker commit -m "java installation" -a "Gabriel" 04b5b89274ce test/centos_java
  89.  
  90. https://docs.docker.com/engine/reference/builder/
  91.  
  92.  
  93. sudo docker build -t testapp --label testapp -m 128M --rm /home/ec2-user
  94.  
  95. Dockerfile
  96. #Dockerfile to install java
  97. # author: Gabriel
  98.  
  99. FROM centos
  100.  
  101. RUN yum install -y java-1.8.0-openjdk-headless
  102.  
  103. ENV APP_PATH /opt/app
  104. RUN mkdir -p $APP_PATH
  105. WORKDIR $APP_PATH
  106. ADD EnvTest.class $APP_PATH
  107.  
  108. EXPOSE 8080
  109.  
  110. #RUN java -cp /opt/app -Xmx64m EnvTest
  111.  
  112. sudo docker run -d cdfe278a45d4 java -cp /opt/app -Xmx64m EnvTest
  113. docker run -v /mnt/shared:/data debian ls /data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement