






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







ubuntu@ip- 172 - 31 - 27 - 3 : ~ $ sudo docker version Client: Version: 24.0. API version: 1. Go version: go1.20. Git commit: 24.0.5-0ubuntu1~22.04. Built: Mon Aug 21 19:50:14 2023 OS/Arch: linux/amd Context: default Server: Engine: Version: 24.0. API version: 1.43 (minimum version 1.12) Go version: go1.20. Git commit: 24.0.5-0ubuntu1~22.04. Built: Mon Aug 21 19:50:14 2023 OS/Arch: linux/amd Experimental: false containerd: Version: 1.7. GitCommit: runc: Version: 1.1.7-0ubuntu1~22.04. GitCommit: docker-init: Version: 0.19. GitCommit: ubuntu@ip- 172 - 31 - 27 - 3 : ~ $ sudo docker - v Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.
ubuntu@ip- 172 - 31 - 27 - 3 : ~ $ docker help Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers
export Export a container's filesystem as a tar archive history Show the history of an image import Import the contents from a tarball to create a filesystem image inspect Return low-level information on Docker objects kill Kill one or more running containers load Load an image from a tar archive or STDIN logs Fetch the logs of a container pause Pause all processes within one or more containers port List port mappings or a specific mapping for the container rename Rename a container restart Restart one or more containers rm Remove one or more containers rmi Remove one or more images save Save one or more images to a tar archive (streamed to STDOUT by default) start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers wait Block until one or more containers stop, then print their exit codes Global Options: --config string Location of client config files (default "/home/ubuntu/.docker")
Run 'docker COMMAND --help' for more information on a command. For more help on how to use Docker, head to https://docs.docker.com/go/guides/
root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker system df TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 0 0 0B 0B Containers 0 0 0B 0B Local Volumes 0 0 0B 0B Build Cache 0 0 0B 0B root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker system info Client: Version: 24.0. Context: default Debug Mode: false Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 24.0. Storage Driver: overlay Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
They are available in multiple Docker images in marketplaces. root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker search busapp root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker search httpd NAME DESCRIPTION STARS OFFICIAL AUTOMATED
manageiq/httpd Container with httpd, built on CentOS for Ma… 1 [OK] centos/httpd- 24 - centos8 3 dockerpinata/httpd 1 19022021/httpd-connection_test This httpd image will test the connectivity … 0 publici/httpd httpd:latest 1 [OK] centos/httpd 36 [OK] httpdocker/kubia 0 e2eteam/httpd 0 manasip/httpd 0 httpdss/archerysec ArcherySec repository 0 [OK] solsson/httpd-openidc mod_auth_openidc on official httpd image, ve… 2 [OK] patrickha/httpd-err 0 hypoport/httpd-cgi httpd-cgi 2 [OK]
root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker pull httpd Using default tag: latest latest: Pulling from library/httpd 578acb154839: Pull complete c1a8c8567b78: Pull complete 10b9ab03bf45: Pull complete 74dbedf7ddc0: Pull complete 6a3b76b70f73: Pull complete Digest: sha256:4e24356b4b0aa7a961e7dfb9e1e5025ca3874c532fa5d999f13f8fc33c09d1b Status: Downloaded newer image for httpd:latest docker.io/library/httpd:latest root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker pull alpine Using default tag: latest latest: Pulling from library/alpine 96526aa774ef: Pull complete Digest: sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc Status: Downloaded newer image for alpine:latest docker.io/library/alpine:latest
root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker ps - a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b07b9d1f902b httpd "httpd-foreground" 3 minutes ago Exited (0) 16 seconds ago web
root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker run - d --name web2 httpd ee5e37f7a9a4f6d731ac50c8a51d57ba5fde6171962c920cbb467c38b7d3db2d
root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker ps - a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ee5e37f7a9a4 httpd "httpd-foreground" About a minute ago Up About a minute 80/tcp web b07b9d1f902b httpd "httpd-foreground" 5 minutes ago Exited (0) 2 minutes ago web
Syntax : sudo docker exec - it web2 (container name) /bin/sh(destination directory) root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker exec - it web2 /bin/sh
/usr/local/apache
root@ee5e37f7a9a4:/usr/local/apache2# root@ee5e37f7a9a4:/usr/local/apache2# cd /bin root@ee5e37f7a9a4:/bin# pwd /bin
root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker exec web2 mkdir /tmp/karthi root@ip- 172 - 31 - 27 - 3:/home/ubuntu# docker exec web2 ls /tmp/karthi
root@ip- 172 - 31 - 27 - 3:/home/ubuntu# sudo docker info Client: Version: 24.0. Context: default Debug Mode: false Server: Containers: 2 Running: 0 Paused: 0 Stopped: 2 Images: 2 Server Version: 24.0. Storage Driver: overlay Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: runc version: init version: Security Options: apparmor seccomp Profile: builtin cgroupns Kernel Version: 6.2.0- 1014 - aws Operating System: Ubuntu 22.04.3 LTS OSType: linux