Docker

Migrating existing containers from Hyper-V to WSL2 technology

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-16 04:33:34
问题 After DockerCon 2020, I enthusiastically downloaded Windows 10 2004 and tried to upgrade Docker Desktop to WSL 2 containers and experiment. I had a few containers, in particular a couple of databases along with their data stored within volumes. Postgres and MS SQL Server in the case. I wouldn't like to lose the data, though it's not critical. I used Docker volumes rather than OS mounts because I have repeatedly seen that using Windows mounts for database data storage is not recommended. When

SpringBoot入门

…衆ロ難τιáo~ 提交于 2021-02-16 03:27:23
一、Spring Boot 入门 1、Spring Boot 简介 简化Spring应用开发的一个框架; 整个Spring技术栈的一个大整合; J2EE开发的一站式解决方案; 2、微服务 2014,martin fowler 微服务:架构风格(服务微化) 一个应用应该是一组小型服务;可以通过HTTP的方式进行互通; 单体应用:ALL IN ONE 微服务:每一个功能元素最终都是一个可独立替换和独立升级的软件单元; 详细参照微服务文档 3、环境准备 环境约束 jdk1.8:Spring Boot 推荐jdk1.7及以上;java version "1.8.0_112" maven3.x:maven 3.3以上版本;Apache Maven 3.3.9 IntelliJIDEA2017:IntelliJ IDEA 2017.2.2 x64、STS SpringBoot 1.5.9.RELEASE:1.5.9; 统一环境; 1、MAVEN设置; 给maven 的settings.xml配置文件的profiles标签添加 <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven

使用Docker部署Spring Boot项目

ⅰ亾dé卋堺 提交于 2021-02-15 13:06:02
本文使用Docker部署Spring Boot项目。部署之前需要环境中已经安装Docker和Maven(用于打包),所以本文先进行安装Docker和Maven;接着搭建一个Spring Boot项目,使其支持Docker部署;最后进行部署和测试。 环境搭建 安装Docker 检查系统内核版本 Docker运行在CentOS 7上,要求操作系统为64位,内核版本为3.10及以上。 确认本机已经安装了满足要求的Linux内核。使用命令 uname -r 来检查内核版本信息。 [root@localhost ~]# uname -r 3.10.0-957.el7.x86_64 在CentOS 7中安装Docker 使用命令 yum install -y docker 安装Docker,“-y”表示不询问,使用默认配置进行安装。 启动Docker服务,并设置为开机自启动 使用下列命令: systemctl start docker.service systemctl enable docker.service 查看版本信息 输入 docker version ,返回版本信息表明Docker安装成功。 [root@localhost ~]# docker version Client: Version: 1.13.1 API version: 1.26 Package version:

docker搭建elk

房东的猫 提交于 2021-02-15 11:05:32
docker run -d -p 5601:5601 -p 9200:9200 -p 5044:5044 -v /opt/data/elk-data:/var/lib/elasticsearch --name elk sebp/elk 1.运行完后报错: max virtual memory areas vm.max_map_count [26214] is too low, increase to at least [262144] 这是因为elasticsearch用户拥有的内存权限太小,至少需要262144。 执行 sysctl -a|grep vm.max_map_count 显示: vm.max_map_count = 26214 使用命令修改: sysctl -w vm.max_map_count=262144 然后在 /etc/sysctl.conf文件最后添加一行 vm.max_map_count=262144。 使用docker ps 查看是否在运行,使用docker images找到本地镜像,使用 docker start [imageId] 运行已存在的镜像。(docker run 生成镜像) 2. 访问elk。(我的虚拟机ip是192.168.1.90) 2.1 5601端口查看Kibana: http://192.168.1.90:5601/ 2.2 es

Docker 构建镜像

丶灬走出姿态 提交于 2021-02-15 09:42:17
Docker 构建镜像 1、首先,在项目的根目录下,新建一个文本文件.dockerignore,写入下面的内容。 下面三行代码表示: 1、这三个路径要排除,不要打包进入 image 文件。 2、如果你没有路径要排除,这个文件可以不新建。 .git node_modules npm -debug.log 2、然后在项目的根目录下,新建一个文本文件 Dockerfile,写入下面的内容。 下面五行代码表示: 1、FROM node:8.4:该 image 文件继承官方的 node image,冒号表示标签,这里标签是8.4,即8.4版本的 node。 2、COPY . /app:将当前目录下的所有文件(除了.dockerignore排除的路径),都拷贝进入 image 文件的/app目录。 3、WORKDIR /app:指定接下来的工作路径为/app。 4、RUN npm install:在/app目录下,运行npm install命令安装依赖。注意,安装后所有的依赖,都将打包进入 image 文件。 5、EXPOSE 3000:将容器 3000 端口暴露出来, 允许外部连接这个端口。 FROM node:8.4 COPY . / app WORKDIR / app RUN npm install --registry=https:// registry.npm.taobao.org

How can I run bash in a new container of a docker image?

て烟熏妆下的殇ゞ 提交于 2021-02-15 08:38:04
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

How can I run bash in a new container of a docker image?

雨燕双飞 提交于 2021-02-15 08:37:14
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

How can I run bash in a new container of a docker image?

北城以北 提交于 2021-02-15 08:36:13
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

How can I run bash in a new container of a docker image?

老子叫甜甜 提交于 2021-02-15 08:35:57
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root

How can I run bash in a new container of a docker image?

坚强是说给别人听的谎言 提交于 2021-02-15 08:35:10
问题 I am able to run arbitrary shell commands in a container created from docker/whalesay image. $ docker run docker/whalesay ls -l total 56 -rw-r--r-- 1 root root 931 May 25 2015 ChangeLog -rw-r--r-- 1 root root 385 May 25 2015 INSTALL -rw-r--r-- 1 root root 1116 May 25 2015 LICENSE -rw-r--r-- 1 root root 445 May 25 2015 MANIFEST -rw-r--r-- 1 root root 1610 May 25 2015 README -rw-r--r-- 1 root root 879 May 25 2015 Wrap.pm.diff drwxr-xr-x 2 root root 4096 May 25 2015 cows -rwxr-xr-x 1 root root