**************************** Installare Docker-ce su Kali Linux **************************** Controlliamo la versione di Linux: kali@kali:~$ uname -a Linux kali 5.10.0-kali9-amd64 #1 SMP Debian 5.10.46-4kali (2021-08-09) x86_64 GNU/Linux Inseriamo il repository all'Apt sources: kali@kali:~$ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list scarichiamo la chiave pubblica: kali@kali:~$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg Se mi da l'errore: kali@kali:~$ gpg: can't create /etc/apt/keyrings/docker.gpg' no such file or directory semplicemente creare la dir: kali@kali:~$ mkdir /etc/apt/keyrings e rilanciare il precedente comando. kali@kali:~$ curl -fsSL https://download.docker.com/linux/debian/gpg |sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg controllare l'esistenza del file docker.pgp kali@kali:~$ ls /etc/apt/keyrings docker.gpg Aggiorniamo: kali@kali:~$ sudo apt update Get:1 https://download.docker.com/linux/debian bookworm InRelease [43.3 kB] Get:2 http://kali.download/kali kali-rolling InRelease [41.5 kB] Get:3 https://download.docker.com/linux/debian bookworm/stable amd64 Packages [19.7 kB] Get:4 https://download.docker.com/linux/debian bookworm/stable amd64 Contents (deb) [1,340 B] Err:2 http://kali.download/kali kali-rolling InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository Fetched 106 kB in 1s (103 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 1672 packages can be upgraded. Run 'apt list --upgradable' to see them. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://kali.download/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository W: Some index files failed to download. They have been ignored, or old ones used instead. In caso di questo errore EXPKEYSIG scaricare la chiave:.... kali@kali:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ED444FF07D8D0BF6 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). Executing: /tmp/apt-key-gpghome.6zNfffbdEF/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ED444FF07D8D0BF6 gpg: key ED444FF07D8D0BF6: 2 duplicate signatures removed gpg: key ED444FF07D8D0BF6: "Kali Linux Repository " 3 new signatures gpg: Total number processed: 1 gpg: new signatures: 3 ... e riproviamo: kali@kali:~$ sudo apt update Hit:1 https://download.docker.com/linux/debian bookworm InRelease Get:2 http://kali.download/kali kali-rolling InRelease [41.5 kB] Get:3 http://kali.download/kali kali-rolling/main amd64 Packages [19.6 MB] Get:4 http://kali.download/kali kali-rolling/main amd64 Contents (deb) [46.7 MB] Get:5 http://kali.download/kali kali-rolling/contrib amd64 Packages [116 kB] Get:6 http://kali.download/kali kali-rolling/contrib amd64 Contents (deb) [245 kB] Get:7 http://kali.download/kali kali-rolling/non-free amd64 Packages [193 kB] Get:8 http://kali.download/kali kali-rolling/non-free amd64 Contents (deb) [892 kB] Fetched 67.7 MB in 17s (3,889 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 1923 packages can be upgraded. Run 'apt list --upgradable' to see them. Installazione di docker: kali@kali:~$ sudo apt install -y docker-ce docker-ce-cli containerd.io Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: docker-buildx-plugin docker-ce-rootless-extras docker-compose-plugin libslirp0 pigz slirp4netns Suggested packages: aufs-tools cgroupfs-mount | cgroup-lite The following NEW packages will be installed: containerd.io docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin libslirp0 pigz slirp4netns 0 upgraded, 9 newly installed, 0 to remove and 1923 not upgraded. Need to get 120 MB of archives. After this operation, 428 MB of additional disk space will be used. Get:1 https://download.docker.com/linux/debian bookworm/stable amd64 containerd.io amd64 1.6.28-2 [29.7 MB] Get:2 http://kali.download/kali kali-rolling/main amd64 pigz amd64 2.8-1 [62.7 kB] Get:3 http://mirror.init7.net/kali kali-rolling/main amd64 libslirp0 amd64 4.7.0-1 [63.0 kB] Get:4 http://kali.download/kali kali-rolling/main amd64 slirp4netns amd64 1.2.1-1 [38.5 kB] Get:5 https://download.docker.com/linux/debian bookworm/stable amd64 docker-buildx-plugin amd64 0.13.1-1~debian.12~bookworm [29.5 MB] Get:6 https://download.docker.com/linux/debian bookworm/stable amd64 docker-ce-cli amd64 5:26.0.0-1~debian.12~bookworm [13.8 MB] Get:7 https://download.docker.com/linux/debian bookworm/stable amd64 docker-ce amd64 5:26.0.0-1~debian.12~bookworm [25.1 MB] Get:8 https://download.docker.com/linux/debian bookworm/stable amd64 docker-ce-rootless-extras amd64 5:26.0.0-1~debian.12~bookworm [9,319 kB] Get:9 https://download.docker.com/linux/debian bookworm/stable amd64 docker-compose-plugin amd64 2.25.0-1~debian.12~bookworm [12.1 MB] Fetched 120 MB in 5s (23.3 MB/s) Selecting previously unselected package pigz. (Reading database ... 271954 files and directories currently installed.) Preparing to unpack .../0-pigz_2.8-1_amd64.deb ... Unpacking pigz (2.8-1) ... Selecting previously unselected package containerd.io. Preparing to unpack .../1-containerd.io_1.6.28-2_amd64.deb ... Unpacking containerd.io (1.6.28-2) ... Selecting previously unselected package docker-buildx-plugin. Preparing to unpack .../2-docker-buildx-plugin_0.13.1-1~debian.12~bookworm_amd64.deb ... Unpacking docker-buildx-plugin (0.13.1-1~debian.12~bookworm) ... Selecting previously unselected package docker-ce-cli. Preparing to unpack .../3-docker-ce-cli_5%3a26.0.0-1~debian.12~bookworm_amd64.deb ... Unpacking docker-ce-cli (5:26.0.0-1~debian.12~bookworm) ... Selecting previously unselected package docker-ce. Preparing to unpack .../4-docker-ce_5%3a26.0.0-1~debian.12~bookworm_amd64.deb ... Unpacking docker-ce (5:26.0.0-1~debian.12~bookworm) ... Selecting previously unselected package docker-ce-rootless-extras. Preparing to unpack .../5-docker-ce-rootless-extras_5%3a26.0.0-1~debian.12~bookworm_amd64.deb ... Unpacking docker-ce-rootless-extras (5:26.0.0-1~debian.12~bookworm) ... Selecting previously unselected package docker-compose-plugin. Preparing to unpack .../6-docker-compose-plugin_2.25.0-1~debian.12~bookworm_amd64.deb ... Unpacking docker-compose-plugin (2.25.0-1~debian.12~bookworm) ... Selecting previously unselected package libslirp0:amd64. Preparing to unpack .../7-libslirp0_4.7.0-1_amd64.deb ... Unpacking libslirp0:amd64 (4.7.0-1) ... Selecting previously unselected package slirp4netns. Preparing to unpack .../8-slirp4netns_1.2.1-1_amd64.deb ... Unpacking slirp4netns (1.2.1-1) ... Setting up docker-buildx-plugin (0.13.1-1~debian.12~bookworm) ... Setting up containerd.io (1.6.28-2) ... containerd.service is a disabled or a static unit, not starting it. Setting up docker-compose-plugin (2.25.0-1~debian.12~bookworm) ... Setting up docker-ce-cli (5:26.0.0-1~debian.12~bookworm) ... Setting up libslirp0:amd64 (4.7.0-1) ... Setting up pigz (2.8-1) ... Setting up docker-ce-rootless-extras (5:26.0.0-1~debian.12~bookworm) ... Setting up slirp4netns (1.2.1-1) ... Setting up docker-ce (5:26.0.0-1~debian.12~bookworm) ... update-rc.d: We have no instructions for the docker init script. update-rc.d: It looks like a non-network service, we enable it. Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service. Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket. Processing triggers for libc-bin (2.36-4) ... Processing triggers for man-db (2.9.4-2) ... Processing triggers for kali-menu (2021.3.3) ... Controlliamo l'avvenuta installazione di docker: kali@kali:~$ sudo docker info Client: Docker Engine - Community Version: 26.0.0 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.13.1 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.25.0 Path: /usr/libexec/docker/cli-plugins/docker-compose Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 26.0.0 Storage Driver: overlay2 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 splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc version: v1.1.12-0-g51d5e94 init version: de40ad0 Security Options: apparmor seccomp Profile: builtin cgroupns Kernel Version: 5.10.0-kali9-amd64 Operating System: Kali GNU/Linux Rolling OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 457.6MiB Name: kali ID: 72b06cda-aa5a-441b-8889-e47c1f430ec3 Docker Root Dir: /var/lib/docker Debug Mode: false Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Scarichiamo dall'hub docker l'immagine di prova hello-world kali@kali:~$ docker run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ Rif: https://www.kali.org/docs/containers/installing-docker-on-kali/ ************* Installare machine-compose curl -L https://github.com/docker/machine/releases/download/v0.3.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine ///////////////// Modifica dei permessi di esecuzione. chmod +x /usr/local/bin/docker-machine ********** Installare docker-compose root@vbox:/home# sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose ///////////////// Modifica dei permessi di esecuzione. root@vbox:/home# sudo chmod +x /usr/local/bin/docker-compose **************************** Installare Docker-ce su Mint 20 Ulyana **************************** #!/bin/bash sudo apt-get update # install dependencies sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common # add the gpg key for docker curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - # add the repository in the Linux mint 20 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable" sudo apt-get update # install docker and docker-compose sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable" ###https://forums.docker.com/t/solved-docker-installation-on-ubuntu-18-04-no-longer-works/78766 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 $ curl -fsSL https://get.docker.com -o get-docker.sh $ sudo sh get-docker.sh # add the user system to sudo group, no sudo command (also useful for VsCode plugins) sudo usermod -aG docker $USER # prints docker version =) docker --version Rif: https://gist.github.com/luisabellan/49aba50891f988976c6d9c8a85ec08d1