Advertisement
beezanteeum

Debug_Docker

Jan 10th, 2021
1,631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 42.87 KB | None | 0 0
  1. dc                                   raidz_test
  2. deallocvt                            ranlib
  3. diff                                 readelf
  4. dirname                              readlink
  5. distro                               realpath
  6. docker                               recode-sr-latin
  7. docker-compose                       rename
  8. doesitcache                          renice
  9. dos2unix                             reset
  10. dotenv                               resize
  11. du                                   rev
  12. dumpleases                           rview
  13. dwp                                  rvim
  14. easy_install-3.8                     scanelf
  15. eject                                scp
  16. elfedit                              script
  17. env                                  scriptlive
  18. envsubst                             scriptreplay
  19. ex                                   seq
  20. expand                               setarch
  21. expr                                 setkeycodes
  22. factor                               setpriv
  23. fallocate                            setsid
  24. file                                 setterm
  25. fincore                              sftp
  26. find                                 sha1sum
  27. findssl.sh                           sha256sum
  28. flock                                sha3sum
  29. fold                                 sha512sum
  30. free                                 showkey
  31. fuser                                shred
  32. g++                                  shuf
  33. gcc                                  size
  34. gcc-ar                               smemcap
  35. gcc-nm                               sort
  36. gcc-ranlib                           split
  37. gcov                                 ssh
  38. gcov-dump                            ssh-add
  39. gcov-tool                            ssh-agent
  40. gdbm_dump                            ssh-copy-id
  41. gdbm_load                            ssh-keygen
  42. gdbmtool                             ssh-keyscan
  43. getconf                              ssh-pkcs11-helper
  44. getent                               ssl_client
  45. getopt                               strings
  46. gettext                              strip
  47. gettext.sh                           sum
  48. gettextize                           tac
  49. git                                  tail
  50. git-receive-pack                     taskset
  51. git-shell                            tee
  52. git-upload-archive                   test
  53. git-upload-pack                      time
  54. gprof                                timeout
  55. groups                               tmux
  56. hardlink                             top
  57. hd                                   tr
  58. head                                 traceroute
  59. hexdump                              traceroute6
  60. hostid                               tree
  61. htdbm                                truncate
  62. htdigest                             tty
  63. htpasswd                             ttysize
  64. httxt2dbm                            udhcpc6
  65. i386                                 ul
  66. iconv                                uname26
  67. id                                   unexpand
  68. install                              uniq
  69. ionice                               unix2dos
  70. ipcmk                                unlink
  71. ipcrm                                unlzma
  72. ipcs                                 unlzop
  73. iptables-xml                         unpigz
  74. isosize                              unshare
  75. jq                                   unxz
  76. jsonschema                           unzip
  77. killall                              uptime
  78. ld                                   utmpdump
  79. ld.bfd                               uudecode
  80. ldd                                  uuencode
  81. less                                 uuidgen
  82. linux32                              uuidparse
  83. linux64                              vi
  84. logger                               view
  85. logresolve                           vim
  86. look                                 vimtutor
  87. lsattr                               vlock
  88. lscpu                                volname
  89. lsipc                                wall
  90. lslocks                              wc
  91. lslogins                             wget
  92. lsmem                                whereis
  93. lsns                                 which
  94. lsof                                 whoami
  95. lsusb                                whois
  96. lzcat                                wsdump.py
  97. lzcmp                                x86_64
  98. lzdiff                               x86_64-alpine-linux-musl-c++
  99. lzegrep                              x86_64-alpine-linux-musl-g++
  100. lzfgrep                              x86_64-alpine-linux-musl-gcc
  101. lzgrep                               x86_64-alpine-linux-musl-gcc-9.3.0
  102. lzless                               x86_64-alpine-linux-musl-gcc-ar
  103. lzma                                 x86_64-alpine-linux-musl-gcc-nm
  104. lzmadec                              x86_64-alpine-linux-musl-gcc-ranlib
  105. lzmainfo                             x86_64-alpine-linux-musl-gdc
  106. lzmore                               xargs
  107. lzopcat                              xgettext
  108. make                                 xmlwf
  109. mcookie                              xxd
  110. md5sum                               xz
  111. mesg                                 xzcat
  112. microcom                             xzcmp
  113. mkfifo                               xzdec
  114. mkpasswd                             xzdiff
  115. msgattrib                            xzegrep
  116. msgcat                               xzfgrep
  117. msgcmp                               xzgrep
  118. msgcomm                              xzless
  119. msgconv                              xzmore
  120. msgen                                yes
  121. msgexec                              zgenhostid
  122. msgfilter                            zvol_wait
  123. [node1] (local) root@192.168.0.8 ~
  124. unknown shorthand flag: 'i' in -it_12 psql -h localhost -U dockeruser -W -d pets
  125. See 'docker --help'.
  126.  
  127. Usage:  docker [OPTIONS] COMMAND
  128.  
  129. A self-sufficient runtime for containers
  130.  
  131. Options:
  132.       --config string      Location of client config files (default
  133.                            "/root/.docker")
  134.   -c, --context string     Name of the context to use to connect to the
  135.                            daemon (overrides DOCKER_HOST env var and
  136.                            default context set with "docker context use")
  137.   -D, --debug              Enable debug mode
  138.   -H, --host list          Daemon socket(s) to connect to
  139.   -l, --log-level string   Set the logging level
  140.                            ("debug"|"info"|"warn"|"error"|"fatal")
  141.                            (default "info")
  142.       --tls                Use TLS; implied by --tlsverify
  143.       --tlscacert string   Trust certs signed only by this CA (default
  144.                            "/root/.docker/ca.pem")
  145.       --tlscert string     Path to TLS certificate file (default
  146.                            "/root/.docker/cert.pem")
  147.       --tlskey string      Path to TLS key file (default
  148.                            "/root/.docker/key.pem")
  149.       --tlsverify          Use TLS and verify the remote
  150.   -v, --version            Print version information and quit
  151.  
  152. Management Commands:
  153.   app*        Docker App (Docker Inc., v0.9.1-beta3)
  154.   builder     Manage builds
  155.   checkpoint  Manage checkpoints
  156.   config      Manage Docker configs
  157.   container   Manage containers
  158.   context     Manage contexts
  159.   image       Manage images
  160.   manifest    Manage Docker image manifests and manifest lists
  161.   network     Manage networks
  162.   node        Manage Swarm nodes
  163.   plugin      Manage plugins
  164.   secret      Manage Docker secrets
  165.   service     Manage services
  166.   stack       Manage Docker stacks
  167.   swarm       Manage Swarm
  168.   system      Manage Docker
  169.   trust       Manage trust on Docker images
  170.   volume      Manage volumes
  171.  
  172. Commands:
  173.   attach      Attach local standard input, output, and error streams to a running container
  174.   build       Build an image from a Dockerfile
  175.   commit      Create a new image from a container's changes
  176.  cp          Copy files/folders between a container and the local filesystem
  177.  create      Create a new container
  178.  diff        Inspect changes to files or directories on a container's filesystem
  179.   events      Get real time events from the server
  180.   exec        Run a command in a running container
  181.   export      Export a container's filesystem as a tar archive
  182.  history     Show the history of an image
  183.  images      List images
  184.  import      Import the contents from a tarball to create a filesystem image
  185.  info        Display system-wide information
  186.  inspect     Return low-level information on Docker objects
  187.  kill        Kill one or more running containers
  188.  load        Load an image from a tar archive or STDIN
  189.  login       Log in to a Docker registry
  190.  logout      Log out from a Docker registry
  191.  logs        Fetch the logs of a container
  192.  pause       Pause all processes within one or more containers
  193.  port        List port mappings or a specific mapping for the container
  194.  ps          List containers
  195.  pull        Pull an image or a repository from a registry
  196.  push        Push an image or a repository to a registry
  197.  rename      Rename a container
  198.  restart     Restart one or more containers
  199.  rm          Remove one or more containers
  200.  rmi         Remove one or more images
  201.  run         Run a command in a new container
  202.  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  203.  search      Search the Docker Hub for images
  204.  start       Start one or more stopped containers
  205.  stats       Display a live stream of container(s) resource usage statistics
  206.  stop        Stop one or more running containers
  207.  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  208.  top         Display the running processes of a container
  209.  unpause     Unpause all processes within one or more containers
  210.  update      Update configuration of one or more containers
  211.  version     Show the Docker version information
  212.  wait        Block until one or more containers stop, then print their exit codes
  213.  
  214. Run 'docker COMMAND --help' for more information on a command.
  215. To get more help with docker, check out guides at https://docs.docker.com/go/guides/
  216.  
  217. [node1] (local) root@192.168.0.8 ~                                             s
  218. unknown shorthand flag: 'i' in -it_12 psql -h localhost -U dockeruser -W -d pets
  219. See 'docker --help'.
  220.  
  221. Usage:  docker [OPTIONS] COMMAND
  222.  
  223. A self-sufficient runtime for containers
  224.  
  225. Options:
  226.      --config string      Location of client config files (default
  227.                           "/root/.docker")
  228.  -c, --context string     Name of the context to use to connect to the
  229.                           daemon (overrides DOCKER_HOST env var and
  230.                           default context set with "docker context use")
  231.  -D, --debug              Enable debug mode
  232.  -H, --host list          Daemon socket(s) to connect to
  233.  -l, --log-level string   Set the logging level
  234.                           ("debug"|"info"|"warn"|"error"|"fatal")
  235.                           (default "info")
  236.      --tls                Use TLS; implied by --tlsverify
  237.      --tlscacert string   Trust certs signed only by this CA (default
  238.                           "/root/.docker/ca.pem")
  239.      --tlscert string     Path to TLS certificate file (default
  240.                           "/root/.docker/cert.pem")
  241.      --tlskey string      Path to TLS key file (default
  242.                           "/root/.docker/key.pem")
  243.      --tlsverify          Use TLS and verify the remote
  244.  -v, --version            Print version information and quit
  245.  
  246. Management Commands:
  247.  app*        Docker App (Docker Inc., v0.9.1-beta3)
  248.  builder     Manage builds
  249.  checkpoint  Manage checkpoints
  250.  config      Manage Docker configs
  251.  container   Manage containers
  252.  context     Manage contexts
  253.  image       Manage images
  254.  manifest    Manage Docker image manifests and manifest lists
  255.  network     Manage networks
  256.  node        Manage Swarm nodes
  257.  plugin      Manage plugins
  258.  secret      Manage Docker secrets
  259.  service     Manage services
  260.  stack       Manage Docker stacks
  261.  swarm       Manage Swarm
  262.  system      Manage Docker
  263.  trust       Manage trust on Docker images
  264.  volume      Manage volumes
  265.  
  266. Commands:
  267.  attach      Attach local standard input, output, and error streams to a running container
  268.  build       Build an image from a Dockerfile
  269.  commit      Create a new image from a container's changes
  270.   cp          Copy files/folders between a container and the local filesystem
  271.   create      Create a new container
  272.   diff        Inspect changes to files or directories on a container's filesystem
  273.  events      Get real time events from the server
  274.  exec        Run a command in a running container
  275.  export      Export a container's filesystem as a tar archive
  276.   history     Show the history of an image
  277.   images      List images
  278.   import      Import the contents from a tarball to create a filesystem image
  279.   info        Display system-wide information
  280.   inspect     Return low-level information on Docker objects
  281.   kill        Kill one or more running containers
  282.   load        Load an image from a tar archive or STDIN
  283.   login       Log in to a Docker registry
  284.   logout      Log out from a Docker registry
  285.   logs        Fetch the logs of a container
  286.   pause       Pause all processes within one or more containers
  287.   port        List port mappings or a specific mapping for the container
  288.   ps          List containers
  289.   pull        Pull an image or a repository from a registry
  290.   push        Push an image or a repository to a registry
  291.   rename      Rename a container
  292.   restart     Restart one or more containers
  293.   rm          Remove one or more containers
  294.   rmi         Remove one or more images
  295.   run         Run a command in a new container
  296.   save        Save one or more images to a tar archive (streamed to STDOUT by default)
  297.   search      Search the Docker Hub for images
  298.   start       Start one or more stopped containers
  299.   stats       Display a live stream of container(s) resource usage statistics
  300.   stop        Stop one or more running containers
  301.   tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  302.   top         Display the running processes of a container
  303.   unpause     Unpause all processes within one or more containers
  304.   update      Update configuration of one or more containers
  305.   version     Show the Docker version information
  306.   wait        Block until one or more containers stop, then print their exit codes
  307.  
  308. Run 'docker COMMAND --help' for more information on a command.
  309. To get more help with docker, check out guides at https://docs.docker.com/go/guides/
  310.  
  311. unknown shorthand flag: 'i' in -it_12 psql -h localhost -U dockeruser -W -d pets
  312. See 'docker --help'.
  313.  
  314. Usage:  docker [OPTIONS] COMMAND
  315.  
  316. A self-sufficient runtime for containers
  317.  
  318. Options:
  319.       --config string      Location of client config files (default
  320.                            "/root/.docker")
  321.   -c, --context string     Name of the context to use to connect to the
  322.                            daemon (overrides DOCKER_HOST env var and
  323.                            default context set with "docker context use")
  324.   -D, --debug              Enable debug mode
  325.   -H, --host list          Daemon socket(s) to connect to
  326.   -l, --log-level string   Set the logging level
  327.                            ("debug"|"info"|"warn"|"error"|"fatal")
  328.                            (default "info")
  329.       --tls                Use TLS; implied by --tlsverify
  330.       --tlscacert string   Trust certs signed only by this CA (default
  331.                            "/root/.docker/ca.pem")
  332.       --tlscert string     Path to TLS certificate file (default
  333.                            "/root/.docker/cert.pem")
  334.       --tlskey string      Path to TLS key file (default
  335.                            "/root/.docker/key.pem")
  336.       --tlsverify          Use TLS and verify the remote
  337.   -v, --version            Print version information and quit
  338.  
  339. Management Commands:
  340.   app*        Docker App (Docker Inc., v0.9.1-beta3)
  341.   builder     Manage builds
  342.   checkpoint  Manage checkpoints
  343.   config      Manage Docker configs
  344.   container   Manage containers
  345.   context     Manage contexts
  346.   image       Manage images
  347.   manifest    Manage Docker image manifests and manifest lists
  348.   network     Manage networks
  349.   node        Manage Swarm nodes
  350.   plugin      Manage plugins
  351.   secret      Manage Docker secrets
  352.   service     Manage services
  353.   stack       Manage Docker stacks
  354.   swarm       Manage Swarm
  355.   system      Manage Docker
  356.   trust       Manage trust on Docker images
  357.   volume      Manage volumes
  358.  
  359. Commands:
  360.   attach      Attach local standard input, output, and error streams to a running container
  361.   build       Build an image from a Dockerfile
  362.   commit      Create a new image from a container's changes
  363.  cp          Copy files/folders between a container and the local filesystem
  364.  create      Create a new container
  365.  diff        Inspect changes to files or directories on a container's filesystem
  366.   events      Get real time events from the server
  367.   exec        Run a command in a running container
  368.   export      Export a container's filesystem as a tar archive
  369.  history     Show the history of an image
  370.  images      List images
  371.  import      Import the contents from a tarball to create a filesystem image
  372.  info        Display system-wide information
  373.  inspect     Return low-level information on Docker objects
  374.  kill        Kill one or more running containers
  375.  load        Load an image from a tar archive or STDIN
  376.  login       Log in to a Docker registry
  377.  logout      Log out from a Docker registry
  378.  logs        Fetch the logs of a container
  379.  pause       Pause all processes within one or more containers
  380.  port        List port mappings or a specific mapping for the container
  381.  ps          List containers
  382.  pull        Pull an image or a repository from a registry
  383.  push        Push an image or a repository to a registry
  384.  rename      Rename a container
  385.  restart     Restart one or more containers
  386.  rm          Remove one or more containers
  387.  rmi         Remove one or more images
  388.  run         Run a command in a new container
  389.  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  390.  search      Search the Docker Hub for images
  391.  start       Start one or more stopped containers
  392.  stats       Display a live stream of container(s) resource usage statistics
  393.  stop        Stop one or more running containers
  394.  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  395.  top         Display the running processes of a container
  396.  unpause     Unpause all processes within one or more containers
  397.  update      Update configuration of one or more containers
  398.  version     Show the Docker version information
  399.  wait        Block until one or more containers stop, then print their exit codes
  400.  
  401. Run 'docker COMMAND --help' for more information on a command.
  402. To get more help with docker, check out guides at https://docs.docker.com/go/guides/
  403.  
  404. [node1] (local) root@192.168.0.8 ~                                             s
  405. unknown shorthand flag: 'i' in -it_12 psql -h localhost -U dockeruser -W -d pets
  406. See 'docker --help'.
  407.  
  408. Usage:  docker [OPTIONS] COMMAND
  409.  
  410. A self-sufficient runtime for containers
  411.  
  412. Options:
  413.      --config string      Location of client config files (default
  414.                           "/root/.docker")
  415.  -c, --context string     Name of the context to use to connect to the
  416.                           daemon (overrides DOCKER_HOST env var and
  417.                           default context set with "docker context use")
  418.  -D, --debug              Enable debug mode
  419.  -H, --host list          Daemon socket(s) to connect to
  420.  -l, --log-level string   Set the logging level
  421.                           ("debug"|"info"|"warn"|"error"|"fatal")
  422.                           (default "info")
  423.      --tls                Use TLS; implied by --tlsverify
  424.      --tlscacert string   Trust certs signed only by this CA (default
  425.                           "/root/.docker/ca.pem")
  426.      --tlscert string     Path to TLS certificate file (default
  427.                           "/root/.docker/cert.pem")
  428.      --tlskey string      Path to TLS key file (default
  429.                           "/root/.docker/key.pem")
  430.      --tlsverify          Use TLS and verify the remote
  431.  -v, --version            Print version information and quit
  432.  
  433. Management Commands:
  434.  app*        Docker App (Docker Inc., v0.9.1-beta3)
  435.  builder     Manage builds
  436.  checkpoint  Manage checkpoints
  437.  config      Manage Docker configs
  438.  container   Manage containers
  439.  context     Manage contexts
  440.  image       Manage images
  441.  manifest    Manage Docker image manifests and manifest lists
  442.  network     Manage networks
  443.  node        Manage Swarm nodes
  444.  plugin      Manage plugins
  445.  secret      Manage Docker secrets
  446.  service     Manage services
  447.  stack       Manage Docker stacks
  448.  swarm       Manage Swarm
  449.  system      Manage Docker
  450.  trust       Manage trust on Docker images
  451.  volume      Manage volumes
  452.  
  453. Commands:
  454.  attach      Attach local standard input, output, and error streams to a running container
  455.  build       Build an image from a Dockerfile
  456.  commit      Create a new image from a container's changes
  457.   cp          Copy files/folders between a container and the local filesystem
  458.   create      Create a new container
  459.   diff        Inspect changes to files or directories on a container's filesystem
  460.  events      Get real time events from the server
  461.  exec        Run a command in a running container
  462.  export      Export a container's filesystem as a tar archive
  463.   history     Show the history of an image
  464.   images      List images
  465.   import      Import the contents from a tarball to create a filesystem image
  466.   info        Display system-wide information
  467.   inspect     Return low-level information on Docker objects
  468.   kill        Kill one or more running containers
  469.   load        Load an image from a tar archive or STDIN
  470.   login       Log in to a Docker registry
  471.   logout      Log out from a Docker registry
  472.   logs        Fetch the logs of a container
  473.   pause       Pause all processes within one or more containers
  474.   port        List port mappings or a specific mapping for the container
  475.   ps          List containers
  476.   pull        Pull an image or a repository from a registry
  477.   push        Push an image or a repository to a registry
  478.   rename      Rename a container
  479.   restart     Restart one or more containers
  480.   rm          Remove one or more containers
  481.   rmi         Remove one or more images
  482.   run         Run a command in a new container
  483.   save        Save one or more images to a tar archive (streamed to STDOUT by default)
  484.   search      Search the Docker Hub for images
  485.   start       Start one or more stopped containers
  486.   stats       Display a live stream of container(s) resource usage statistics
  487.   stop        Stop one or more running containers
  488.   tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  489.   top         Display the running processes of a container
  490.   unpause     Unpause all processes within one or more containers
  491.   update      Update configuration of one or more containers
  492.   version     Show the Docker version information
  493.   wait        Block until one or more containers stop, then print their exit codes
  494.  
  495. Run 'docker COMMAND --help' for more information on a command.
  496. To get more help with docker, check out guides at https://docs.docker.com/go/guides/
  497.  
  498. [node1] (local) root@192.168.0.8 ~
  499. $ ~echo FROM postgres:12-alpine > Dockerfile
  500. bash: ~echo: command not found
  501. [node1] (local) root@192.168.0.8 ~
  502. $ docker exec -it widi_postgresql_12 psql -h localhost -U dockeruser -W -d pets
  503. Error response from daemon: Container 69be194912423e3b6b503389a06140927205aac83b4dee0934cd6e680beb592f is not running
  504. [node1] (local) root@192.168.0.8 ~
  505. $ docker run -p 5432:5432 --name widi_postgresql_12 -d widi_postgresql_12
  506. docker: Error response from daemon: Conflict. The container name "/widi_postgresql_12" is already in use by container "69be194912423e3b6b503389a06140927205aac83b4dee0934cd6e680beb592f". You have to remove (or rename) that container to be able to reuse that name.
  507. See 'docker run --help'.
  508. [node1] (local) root@192.168.0.8 ~
  509. $ docker stop widi_postgresql_12
  510. widi_postgresql_12
  511. [node1] (local) root@192.168.0.8 ~
  512. $ docker container rm widi_postgresql_12
  513. widi_postgresql_12
  514. [node1] (local) root@192.168.0.8 ~
  515. $ docker run -p 5432:5432 --name widi_postgresql_12 -d widi_postgresql_12
  516. ccabf90f2a1931150730a64571fa364e166b48f1cb31e9230bdf4a2f01aa9254
  517. [node1] (local) root@192.168.0.8 ~
  518. $ docker exec -it widi_postgresql_12 psql -h localhost -U dockeruser -W -d pets
  519. Error response from daemon: Container ccabf90f2a1931150730a64571fa364e166b48f1cb31e9230bdf4a2f01aa9254 is not running
  520. [node1] (local) root@192.168.0.8 ~
  521. $ docker run -it -p 5432:5432 --name widi_postgresql_12 -d widi_postgresql_12
  522. docker: Error response from daemon: Conflict. The container name "/widi_postgresql_12" is already in use by container "ccabf90f2a1931150730a64571fa364e166b48f1cb31e9230bdf4a2f01aa9254". You have to remove (or rename) that container to be able to reuse that name.
  523. See 'docker run --help'.
  524. [node1] (local) root@192.168.0.8 ~
  525. $ docker stop widi_postgresql_12
  526. widi_postgresql_12
  527. [node1] (local) root@192.168.0.8 ~
  528. $ docker container rm widi_postgresql_12
  529. widi_postgresql_12
  530. [node1] (local) root@192.168.0.8 ~
  531. $ docker run -it -p 5432:5432 --name widi_postgresql_12 -d widi_postgresql_12
  532. e87c83b6f028d2c2582e571cbc1395ca4887a607a8ce904c03e2d3123ac4d8b2
  533. [node1] (local) root@192.168.0.8 ~
  534. $ cd database
  535. [node1] (local) root@192.168.0.8 ~/database
  536. $ docker exec -it widi_postgresql_12 psql -h localhost -U dockeruser -W -d pets
  537. Error response from daemon: Container e87c83b6f028d2c2582e571cbc1395ca4887a607a8ce904c03e2d3123ac4d8b2 is not running
  538. [node1] (local) root@192.168.0.8 ~/database
  539. $ psql -h localhost -U dockeruser -W -d pets
  540. bash: psql: command not found
  541. [node1] (local) root@192.168.0.8 ~/database
  542. $ psql -h localhost -U dockeruser -W -d pets
  543. bash: psql: command not found
  544. [node1] (local) root@192.168.0.8 ~/database
  545. $ cd ~
  546. [node1] (local) root@192.168.0.8 ~
  547. $ mkdir web
  548. [node1] (local) root@192.168.0.8 ~
  549. $ echo > Dockerfile
  550. [node1] (local) root@192.168.0.8 ~
  551. $ mv Dockerfile /web
  552. [node1] (local) root@192.168.0.8 ~
  553. $ ls web
  554. [node1] (local) root@192.168.0.8 ~
  555. $ cd web
  556. [node1] (local) root@192.168.0.8 ~/web
  557. $ echo > Dockerfile
  558. [node1] (local) root@192.168.0.8 ~/web
  559. $ sshd restart
  560. sshd re-exec requires execution with an absolute path
  561. [node1] (local) root@192.168.0.8 ~/web
  562. $ sshd ~/web
  563. sshd re-exec requires execution with an absolute path
  564. [node1] (local) root@192.168.0.8 ~/web
  565. $ ls
  566. 3-female-lions.png  buffalo.png         hippos.png          male-lion.png       zebra.png
  567. Dockerfile          cheetah.png         index.html          package.json
  568. antelopes.png       elephants.png       jackal.png          server.js
  569. birds.png           giraffe.png         main.css            vulture.png
  570. [node1] (local) root@192.168.0.8 ~/web
  571. $ rm *.png
  572. [node1] (local) root@192.168.0.8 ~/web
  573. $ rm *.js
  574. [node1] (local) root@192.168.0.8 ~/web
  575. $ ls
  576. Dockerfile    index.html    main.css      package.json
  577. [node1] (local) root@192.168.0.8 ~/web
  578. $ rm *.json
  579. [node1] (local) root@192.168.0.8 ~/web
  580. $ rm *.css
  581. [node1] (local) root@192.168.0.8 ~/web
  582. $ rm *.html
  583. [node1] (local) root@192.168.0.8 ~/web
  584. $ mkdir public
  585. [node1] (local) root@192.168.0.8 ~/web
  586. $ cd public
  587. [node1] (local) root@192.168.0.8 ~/web/public
  588. $ mkdir css
  589. [node1] (local) root@192.168.0.8 ~/web/public
  590. $ mkdir images
  591. [node1] (local) root@192.168.0.8 ~/web/public
  592. $ cd css
  593. [node1] (local) root@192.168.0.8 ~/web/public/css
  594. $ cd ~
  595. [node1] (local) root@192.168.0.8 ~
  596. $ cd web/public/images
  597. [node1] (local) root@192.168.0.8 ~/web/public/images
  598. $ cd .
  599. [node1] (local) root@192.168.0.8 ~/web/public/images
  600. $ cd ./
  601. [node1] (local) root@192.168.0.8 ~/web/public/images
  602. $ cd ../
  603. [node1] (local) root@192.168.0.8 ~/web/public
  604. $ cd ../
  605. [node1] (local) root@192.168.0.8 ~/web
  606. $ ls
  607. Dockerfile    package.json  public
  608. [node1] (local) root@192.168.0.8 ~/web
  609. $ mkdir src
  610. [node1] (local) root@192.168.0.8 ~/web
  611. $ cd src
  612. [node1] (local) root@192.168.0.8 ~/web/src
  613. $ cd ~
  614. [node1] (local) root@192.168.0.8 ~
  615. $ ls
  616. database  web
  617. [node1] (local) root@192.168.0.8 ~
  618. $ mkdir images
  619. [node1] (local) root@192.168.0.8 ~
  620. $ cd images
  621. [node1] (local) root@192.168.0.8 ~/images
  622. $ cd ~
  623. [node1] (local) root@192.168.0.8 ~
  624. $ cd web
  625. [node1] (local) root@192.168.0.8 ~/web
  626. $ docker build --tag widi_web_12 .
  627. Sending build context to Docker daemon  9.231MB
  628. Step 1/9 : FROM node:12.10-alpine
  629. 12.10-alpine: Pulling from library/node
  630. e7c96db7181b: Pull complete
  631. 95b3c812425e: Pull complete
  632. 778b81d0468f: Pull complete
  633. 28549a15ba3e: Pull complete
  634. Digest: sha256:744b156ec2dca0ad8291f80f9093273d45eb85378b6290b2fbbada861cc3ed01
  635. Status: Downloaded newer image for node:12.10-alpine
  636.  ---> ef7d474eab14
  637. Step 2/9 : RUN mkdir /app
  638.  ---> Running in 9534350de3d0
  639. Removing intermediate container 9534350de3d0
  640.  ---> 7d16e5d67abb
  641. Step 3/9 : WORKDIR /app
  642.  ---> Running in ac7d4c5e272e
  643. Removing intermediate container ac7d4c5e272e
  644.  ---> c74f2cb4510e
  645. Step 4/9 : COPY package.json /app/
  646.  ---> b79550738023
  647. Step 5/9 : RUN npm install
  648.  ---> Running in 32809af3ce7a
  649. npm notice created a lockfile as package-lock.json. You should commit this file.
  650. npm WARN pets@2.0.0 No repository field.
  651.  
  652. added 75 packages from 55 contributors and audited 75 packages in 3.605s
  653. found 0 vulnerabilities
  654.  
  655. Removing intermediate container 32809af3ce7a
  656.  ---> 589fbd26271e
  657. Step 6/9 : COPY ./public /app/public
  658.  ---> 0f2ac50e0b13
  659. Step 7/9 : COPY ./src /app/src
  660.  ---> a4188f13622e
  661. Step 8/9 : EXPOSE 3000
  662.  ---> Running in b5c51465819a
  663. Removing intermediate container b5c51465819a
  664.  ---> e38113f51917
  665. Step 9/9 : CMD node src/server.js
  666.  ---> Running in c1b2edbf5e72
  667. Removing intermediate container c1b2edbf5e72
  668.  ---> cf9b51e191a8
  669. Successfully built cf9b51e191a8
  670. Successfully tagged widi_web_12:latest
  671. [node1] (local) root@192.168.0.8 ~/web
  672. $ run npm install
  673. bash: run: command not found
  674. [node1] (local) root@192.168.0.8 ~/web
  675. $ npm instal
  676. bash: npm: command not found
  677. [node1] (local) root@192.168.0.8 ~/web
  678. $ docker run --name widi_web_12 -d -p 3000:3000 widi_web_12
  679. 068a35bbd591380f4db4a1fd42599cf2a9314df3977098141c3a8f7af4a4953e
  680. [node1] (local) root@192.168.0.8 ~/web
  681. $ cd ~
  682. [node1] (local) root@192.168.0.8 ~
  683. $ docker-compose -f docker-compose-dev.yml up --build
  684. ERROR: .FileNotFoundError: [Errno 2] No such file or directory: './docker-compose-dev.yml'
  685. [node1] (local) root@192.168.0.8 ~
  686. $ docker-compose -f docker-compose.dev.yml up --build
  687. Creating volume "root_pets-data" with default driver
  688. Building db
  689. Step 1/5 : FROM postgres:12-alpine
  690.  ---> 10608227870c
  691. Step 2/5 : COPY init-db.sql /docker-entrypoint-initdb.d/
  692.  ---> ff79e6d3fefd
  693. Step 3/5 : ENV POSTGRES_USER dockeruser
  694.  ---> Running in 425b24c9bd1e
  695. Removing intermediate container 425b24c9bd1e
  696.  ---> 64f2f6841c5f
  697. Step 4/5 : ENV POSTGRES_PASSWORD dockerpass
  698.  ---> Running in e1b16d88921f
  699. Removing intermediate container e1b16d88921f
  700.  ---> 62b878654698
  701. Step 5/5 : ENV POSTGRES_DB pets
  702.  ---> Running in a434b119bc7b
  703. Removing intermediate container a434b119bc7b
  704.  ---> d2a9567b69bf
  705. Successfully built d2a9567b69bf
  706. Successfully tagged root_db:latest
  707. Building web
  708. Step 1/9 : FROM node:12.10-alpine
  709.  ---> ef7d474eab14
  710. Step 2/9 : RUN mkdir /app
  711.  ---> Using cache
  712.  ---> 7d16e5d67abb
  713. Step 3/9 : WORKDIR /app
  714.  ---> Using cache
  715.  ---> c74f2cb4510e
  716. Step 4/9 : COPY package.json /app/
  717.  ---> 6e26696db820
  718. Step 5/9 : RUN npm install
  719.  ---> Running in d421c64a5cba
  720. npm notice created a lockfile as package-lock.json. You should commit this file.
  721. npm WARN pets@2.0.0 No repository field.
  722.  
  723. added 75 packages from 55 contributors and audited 75 packages in 3.329s
  724. found 0 vulnerabilities
  725.  
  726. Removing intermediate container d421c64a5cba
  727.  ---> a8b08c39043a
  728. Step 6/9 : COPY ./public /app/public
  729.  ---> 122e3017f581
  730. Step 7/9 : COPY ./src /app/src
  731.  ---> f1b984754bdd
  732. Step 8/9 : EXPOSE 3000
  733.  ---> Running in 7cab8711ea5d
  734. Removing intermediate container 7cab8711ea5d
  735.  ---> 9b36172282fb
  736. Step 9/9 : CMD node src/server.js
  737.  ---> Running in 8fee89348430
  738. Removing intermediate container 8fee89348430
  739.  ---> f14bfa22d52a
  740. Successfully built f14bfa22d52a
  741. Successfully tagged root_web:latest
  742. Creating root_db_1 ... done
  743. Creating root_web_1 ...
  744. Creating root_web_1 ... error
  745.  
  746. ERROR: for root_web_1  Cannot start service web: driver failed programming external connectivity on endpoint root_web_1 (8fe09738156a1c099f3d23c20630cbf2eff92676dcb4c4150cd83ea7eb54be9f): Bind for 0.0.0.0:3000 failed: port is already allocated
  747.  
  748. ERROR: for web  Cannot start service web: driver failed programming external connectivity on endpoint root_web_1 (8fe09738156a1c099f3d23c20630cbf2eff92676dcb4c4150cd83ea7eb54be9f): Bind for 0.0.0.0:3000 failed: port is already allocated
  749. ERROR: Encountered errors while bringing up the project.
  750. [node1] (local) root@192.168.0.8 ~
  751. $ docker-compose -f docker-compose.dev.yml up --build
  752. Building db
  753. Step 1/5 : FROM postgres:12-alpine
  754.  ---> 10608227870c
  755. Step 2/5 : COPY init-db.sql /docker-entrypoint-initdb.d/
  756.  ---> Using cache
  757.  ---> ff79e6d3fefd
  758. Step 3/5 : ENV POSTGRES_USER dockeruser
  759.  ---> Using cache
  760.  ---> 64f2f6841c5f
  761. Step 4/5 : ENV POSTGRES_PASSWORD dockerpass
  762.  ---> Using cache
  763.  ---> 62b878654698
  764. Step 5/5 : ENV POSTGRES_DB pets
  765.  ---> Using cache
  766.  ---> d2a9567b69bf
  767. Successfully built d2a9567b69bf
  768. Successfully tagged root_db:latest
  769. Building web
  770. Step 1/9 : FROM node:12.10-alpine
  771.  ---> ef7d474eab14
  772. Step 2/9 : RUN mkdir /app
  773.  ---> Using cache
  774.  ---> 7d16e5d67abb
  775. Step 3/9 : WORKDIR /app
  776.  ---> Using cache
  777.  ---> c74f2cb4510e
  778. Step 4/9 : COPY package.json /app/
  779.  ---> Using cache
  780.  ---> 6e26696db820
  781. Step 5/9 : RUN npm install
  782.  ---> Using cache
  783.  ---> a8b08c39043a
  784. Step 6/9 : COPY ./public /app/public
  785.  ---> Using cache
  786.  ---> 122e3017f581
  787. Step 7/9 : COPY ./src /app/src
  788.  ---> Using cache
  789.  ---> f1b984754bdd
  790. Step 8/9 : EXPOSE 3000
  791.  ---> Using cache
  792.  ---> 9b36172282fb
  793. Step 9/9 : CMD node src/server.js
  794.  ---> Using cache
  795.  ---> f14bfa22d52a
  796. Successfully built f14bfa22d52a
  797. Successfully tagged root_web:latest
  798. Starting root_db_1 ... done
  799. Starting root_web_1 ... done
  800. Attaching to root_db_1, root_web_1
  801. db_1   |
  802. db_1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
  803. db_1   |
  804. db_1   | 2021-01-10 13:59:51.271 UTC [1] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit
  805. db_1   | 2021-01-10 13:59:51.273 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
  806. db_1   | 2021-01-10 13:59:51.274 UTC [1] LOG:  listening on IPv6 address "::", port 5432
  807. db_1   | 2021-01-10 13:59:51.279 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  808. db_1   | 2021-01-10 13:59:51.306 UTC [21] LOG:  database system was interrupted; last known up at 2021-01-10 13:57:18 UTC
  809. db_1   | 2021-01-10 13:59:51.349 UTC [21] LOG:  database system was not properly shut down; automatic recovery in progress
  810. db_1   | 2021-01-10 13:59:51.394 UTC [21] LOG:  redo starts at 0/164DEB0
  811. db_1   | 2021-01-10 13:59:51.394 UTC [21] LOG:  invalid record length at 0/164DFA8: wanted 24, got 0
  812. db_1   | 2021-01-10 13:59:51.394 UTC [21] LOG:  redo done at 0/164DF60
  813. db_1   | 2021-01-10 13:59:51.447 UTC [1] LOG:  database system is ready to accept connections
  814. web_1  | Listening at 0.0.0.0:3000
  815. web_1  | Connecting to DB
  816. web_1  | Connected!
  817. web_1  | Random = 6
  818. web_1  | SQL = SELECT * FROM images WHERE imageid=6
  819. db_1   | 2021-01-10 14:00:00.408 UTC [28] ERROR:  relation "images" does not exist at character 15
  820. db_1   | 2021-01-10 14:00:00.408 UTC [28] STATEMENT:  SELECT * FROM images WHERE imageid=6
  821. web_1  | error: relation "images" does not exist
  822. web_1  |     at Connection.parseE (/app/node_modules/pg/lib/connection.js:614:13)
  823. web_1  |     at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:413:19)
  824. web_1  |     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:129:22)
  825. web_1  |     at Socket.emit (events.js:209:13)
  826. web_1  |     at addChunk (_stream_readable.js:305:12)
  827. web_1  |     at readableAddChunk (_stream_readable.js:286:11)
  828. web_1  |     at Socket.Readable.push (_stream_readable.js:220:10)
  829. web_1  |     at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
  830. web_1  |   name: 'error',
  831. web_1  |   length: 105,
  832. web_1  |   severity: 'ERROR',
  833. web_1  |   code: '42P01',
  834. web_1  |   detail: undefined,
  835. web_1  |   hint: undefined,
  836. web_1  |   position: '15',
  837. web_1  |   internalPosition: undefined,
  838. web_1  |   internalQuery: undefined,
  839. web_1  |   where: undefined,
  840. web_1  |   schema: undefined,
  841. web_1  |   table: undefined,
  842. web_1  |   column: undefined,
  843. web_1  |   dataType: undefined,
  844. web_1  |   constraint: undefined,
  845. web_1  |   file: 'parse_relation.c',
  846. web_1  |   line: '1191',
  847. web_1  |   routine: 'parserOpenTable'
  848. web_1  | } undefined
  849. web_1  | /app/src/server.js:40
  850. web_1  |         const url = result.rows[0].url;
  851. web_1  |                            ^
  852. web_1  |
  853. web_1  | TypeError: Cannot read property 'rows' of undefined
  854. web_1  |     at Query.callback (/app/src/server.js:40:28)
  855. web_1  |     at Query.handleError (/app/node_modules/pg/lib/query.js:145:17)
  856. web_1  |     at Connection.connectedErrorMessageHandler (/app/node_modules/pg/lib/client.js:214:17)
  857. web_1  |     at Connection.emit (events.js:209:13)
  858. web_1  |     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:134:12)
  859. web_1  |     at Socket.emit (events.js:209:13)
  860. web_1  |     at addChunk (_stream_readable.js:305:12)
  861. web_1  |     at readableAddChunk (_stream_readable.js:286:11)
  862. web_1  |     at Socket.Readable.push (_stream_readable.js:220:10)
  863. web_1  |     at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
  864. root_web_1 exited with code 1
  865. cd /database^[[D^[[D^[[D^[[D^[[D
  866. ^CGracefully stopping... (press Ctrl+C again to force)
  867. Stopping root_db_1  ... done
  868. [node1] (local) root@192.168.0.8 ~
  869. $ cd database
  870. [node1] (local) root@192.168.0.8 ~/database
  871. $ cd ~
  872. [node1] (local) root@192.168.0.8 ~
  873. $ ls
  874. Nodes.md                docker-compose.dev.yml  web
  875. database                images
  876. [node1] (local) root@192.168.0.8 ~
  877. $ docker-compose -f docker-compose.dev.yml up --build
  878. Building db
  879. Step 1/6 : FROM postgres:12-alpine
  880.  ---> 10608227870c
  881. Step 2/6 : COPY init-db.sql /docker-entrypoint-initdb.d/
  882.  ---> Using cache
  883.  ---> ff79e6d3fefd
  884. Step 3/6 : ENV POSTGRES_USER dockeruser
  885.  ---> Using cache
  886.  ---> 64f2f6841c5f
  887. Step 4/6 : ENV POSTGRES_PASSWORD dockerpass
  888.  ---> Using cache
  889.  ---> 62b878654698
  890. Step 5/6 : ENV POSTGRES_DB pets
  891.  ---> Using cache
  892.  ---> d2a9567b69bf
  893. Step 6/6 : EXPOSE 5432
  894.  ---> Running in 9d02a775a5d2
  895. Removing intermediate container 9d02a775a5d2
  896.  ---> 3caaa08d8a1d
  897. Successfully built 3caaa08d8a1d
  898. Successfully tagged root_db:latest
  899. Building web
  900. Step 1/9 : FROM node:12.10-alpine
  901.  ---> ef7d474eab14
  902. Step 2/9 : RUN mkdir /app
  903.  ---> Using cache
  904.  ---> 7d16e5d67abb
  905. Step 3/9 : WORKDIR /app
  906.  ---> Using cache
  907.  ---> c74f2cb4510e
  908. Step 4/9 : COPY package.json /app/
  909.  ---> Using cache
  910.  ---> 6e26696db820
  911. Step 5/9 : RUN npm install
  912.  ---> Using cache
  913.  ---> a8b08c39043a
  914. Step 6/9 : COPY ./public /app/public
  915.  ---> Using cache
  916.  ---> 122e3017f581
  917. Step 7/9 : COPY ./src /app/src
  918.  ---> Using cache
  919.  ---> f1b984754bdd
  920. Step 8/9 : EXPOSE 3000
  921.  ---> Using cache
  922.  ---> 9b36172282fb
  923. Step 9/9 : CMD node src/server.js
  924.  ---> Using cache
  925.  ---> f14bfa22d52a
  926. Successfully built f14bfa22d52a
  927. Successfully tagged root_web:latest
  928. Recreating root_db_1 ... done
  929. Recreating root_web_1 ... done
  930. Attaching to root_db_1, root_web_1
  931. db_1   |
  932. db_1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
  933. db_1   |
  934. db_1   | 2021-01-10 14:01:44.657 UTC [1] LOG:  starting PostgreSQL 12.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit
  935. db_1   | 2021-01-10 14:01:44.661 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
  936. db_1   | 2021-01-10 14:01:44.662 UTC [1] LOG:  listening on IPv6 address "::", port 5432
  937. db_1   | 2021-01-10 14:01:44.664 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  938. db_1   | 2021-01-10 14:01:44.719 UTC [22] LOG:  database system was shut down at 2021-01-10 14:01:08 UTC
  939. db_1   | 2021-01-10 14:01:44.728 UTC [1] LOG:  database system is ready to accept connections
  940. web_1  | Listening at 0.0.0.0:3000
  941. web_1  | Connecting to DB
  942. web_1  | Connected!
  943. web_1  | Random = 6
  944. web_1  | SQL = SELECT * FROM images WHERE imageid=6
  945. db_1   | 2021-01-10 14:02:06.704 UTC [29] ERROR:  relation "images" does not exist at character 15
  946. db_1   | 2021-01-10 14:02:06.704 UTC [29] STATEMENT:  SELECT * FROM images WHERE imageid=6
  947. web_1  | error: relation "images" does not exist
  948. web_1  |     at Connection.parseE (/app/node_modules/pg/lib/connection.js:614:13)
  949. web_1  |     at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:413:19)
  950. web_1  |     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:129:22)
  951. web_1  |     at Socket.emit (events.js:209:13)
  952. web_1  |     at addChunk (_stream_readable.js:305:12)
  953. web_1  |     at readableAddChunk (_stream_readable.js:286:11)
  954. web_1  |     at Socket.Readable.push (_stream_readable.js:220:10)
  955. web_1  |     at TCP.onStreamRead (internal/stream_base_commons.js:182:23) {
  956. web_1  |   name: 'error',
  957. web_1  |   length: 105,
  958. web_1  |   severity: 'ERROR',
  959. web_1  |   code: '42P01',
  960. web_1  |   detail: undefined,
  961. web_1  |   hint: undefined,
  962. web_1  |   position: '15',
  963. web_1  |   internalPosition: undefined,
  964. web_1  |   internalQuery: undefined,
  965. web_1  |   where: undefined,
  966. web_1  |   schema: undefined,
  967. web_1  |   table: undefined,
  968. web_1  |   column: undefined,
  969. web_1  |   dataType: undefined,
  970. web_1  |   constraint: undefined,
  971. web_1  |   file: 'parse_relation.c',
  972. web_1  |   line: '1191',
  973. web_1  |   routine: 'parserOpenTable'
  974. web_1  | } undefined
  975. web_1  | /app/src/server.js:40
  976. web_1  |         const url = result.rows[0].url;
  977. web_1  |                            ^
  978. web_1  |
  979. web_1  | TypeError: Cannot read property 'rows' of undefined
  980. web_1  |     at Query.callback (/app/src/server.js:40:28)
  981. web_1  |     at Query.handleError (/app/node_modules/pg/lib/query.js:145:17)
  982. web_1  |     at Connection.connectedErrorMessageHandler (/app/node_modules/pg/lib/client.js:214:17)
  983. web_1  |     at Connection.emit (events.js:209:13)
  984. web_1  |     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:134:12)
  985. web_1  |     at Socket.emit (events.js:209:13)
  986. web_1  |     at addChunk (_stream_readable.js:305:12)
  987. web_1  |     at readableAddChunk (_stream_readable.js:286:11)
  988. web_1  |     at Socket.Readable.push (_stream_readable.js:220:10)
  989. web_1  |     at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
  990. root_web_1 exited with code 1
  991. ^CGracefully stopping... (press Ctrl+C again to force)
  992. Stopping root_db_1    ... done
  993. [node1] (local) root@192.168.0.8 ~
  994. $ psql -h localhost -U dockeruser -W -d pets
  995. bash: psql: command not found
  996. [node1] (local) root@192.168.0.8 ~
  997. $ docker exec -it psql -h localhost -U dockeruser -W -d pets
  998. Error: No such container: psql
  999. [node1] (local) root@192.168.0.8 ~
  1000. $ docker exec -it psql -h localhost -U dockeruser -W -d pets
  1001. Error: No such container: psql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement