首页 安全防御正文

可信赖的黑客接单平台哪里找专业黑客先做事后付款3

访客 安全防御 2022-05-16 1053 1 黑客

项目需要:

安装Dockeridea中安装docker插件,并配置docker一个SpringBoot项目创建Dockerfile

一、下载、安装、配置Docker下载Docker

下载地址:官网下载 Docker

安装

一直下一步就行

配置路径:Settings–General 勾选Expose daemon on tcp://localhost:2375 without TLS

设置镜像,提高下载镜像的速度https://xaiqlt1z.mirror.aliyuncs.com

测试是否安装成功

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
C:\Users\msi>docker -v
Docker version 19.03.12, build 48a66213fe
C:\Users\msi> 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/

二、Idea 安装Docker插件

1.安装docker插件在idea中: file--Plugins--Marketplace 搜索 Docker 安装

2.配置Docker服务

file – 搜索docker – 选择Docker – 右侧添加一个DockerConnection successful 显示,表示 Docker链接成功

三、创建SpringBoot项目,修改pom.xmlspringMVC 项目,访问 localhost:8080/hello 显示 hello 字符串

1
2
3
4
5
@RequestMapping("/hello")
@ResponseBody
public String hello () {
return "hello";
}

1.配置pom.xml 文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version> 1.2.1</version>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<imageName>${project.artifactId}</imageName>
<imageTags>
<imageTag>latest</imageTag>
</imageTags>
<dockerDirectory>${project.basedir}</dockerDirectory>
<dockerHost>http://localhost:2375</dockerHost>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>

2.创建Docker 文件

在main文件夹下创建一个docker文件夹,并在里面创建一个Dockerfile文件。xxxxx.jar 是使用maven打包后复制进来的。

版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。