# Install package manager sudo apt install snapd # Install Docker Engine, Docker Client and Docker Compose sudo snap install docker # Run Docker commands without sudo sudo. To install Docker on Kali you need to remember that there is already a package named “docker”, therefore Docker has to be installed under a different name. If you install docker you will not end up with the container version. The version we will be installing is named docker.io. All commands are the same however, so running docker on the command line will be the appropriate command. RUN apt-get update && apt-get -y -no-install-recommends install libxml2-dev && docker-php-ext-install mbstring pdo pdomysql soap && pecl install sqlsrv pdosqlsrv xdebug && docker-php-ext-enable sqlsrv pdosqlsrv xdebug.

  1. Apt Install Docker
  2. Apt Install Docker Ubuntu 20.04
Docker 安装 Python

方法一、docker pull tomcat

查找 Docker Hub 上的 Tomcat 镜像:

可以通过 Sort by 查看其他版本的 tomcat,默认是最新版本 tomcat:latest

此外,我们还可以用 docker search tomcat 命令来查看可用版本:

这里我们拉取官方的镜像: Download cleanmymac x for free.

等待下载完成后,我们就可以在本地镜像列表里查到 REPOSITORY 为 tomcat 的镜像。

方法二、通过 Dockerfile 构建

创建Dockerfile

首先,创建目录tomcat,用于存放后面的相关东西。

webapps 目录将映射为 tomcat 容器配置的应用程序目录。

Apt install docker ubuntu 20.04

logs 目录将映射为 tomcat 容器的日志目录。

conf 目录里的配置文件将映射为 tomcat 容器的配置文件。

进入创建的 tomcat 目录,创建 Dockerfile。

通过 Dockerfile 创建一个镜像,替换成你自己的名字:

创建完成后,我们可以在本地的镜像列表里查找到刚刚创建的镜像:

使用 tomcat 镜像

运行容器

命令说明:

Apt install docker-machine

-p 8080:8080:将主机的 8080 端口映射到容器的 8080 端口。

-v $PWD/test:/usr/local/tomcat/webapps/test:将主机中当前目录下的 test 挂载到容器的 /test。

查看容器启动情况

通过浏览器访问

Docker 安装 Python

Apt Install Docker

To install Docker on Kali you need to remember that there is already a package named “docker”, therefore Docker has to be installed under a different name. If you install docker you will not end up with the container version. The version we will be installing is named docker.io. All commands are the same however, so running docker on the command line will be the appropriate command.

You can now get started with using docker, with sudo. If you want to add yourself to the docker group to use docker without sudo, an additional step is needed:

The final thing is to logout and in again.

Install

If you would like to use a Kali Docker image, we have a doc page for that here.

Installing docker-ce on Kali Linux

docker-ce can be installed from Docker repository. One thing to bare in mind, Kali Linux is based on Debian, so we need to use Debian’s current stable version (even though Kali Linux is a rolling distribution). At the time of writing, its “buster”:

Import the gpg key:

Fingerprint checking:

Install the latest version of docker-ce:

Apt Install Docker Ubuntu 20.04

References
Coments are closed
Scroll to top