本文记录一下,在docker中安装Mongodb的过程。

  环境:物理机 ubuntu18.04

  因为环境变了,我在一台物理机上直接安装了ubuntu(非虚拟机和双系统),制作U盘镜像、安装参考:https://ywnz.com/linuxaz/1438.html,所以这次又参照在docker中初次体验.net core 2.0安装了一遍docker,但是进行的不是很顺利。执行命令:sudo apt-get install docker-ce 时会报错,安装docker时不再使用“docker-ce”而是“docker.io”,ubuntu建议使用apt而非apt-get。至于两者的区别,参考:https://www.sysgeek.cn/apt-vs-apt-get/

  一、在Ubuntu 18.04中安装docker

    以下是安装过程截图:

、sudo apt remove docker.io
、sudo apt-get install docker-ce
、docker
、sudo apt remove docker docker-engine docker.io
、sudo apt update
、sudo apt install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
、curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
、sudo apt-key fingerprint 0EBFCD88
、sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
、sudo apt update
、sudo apt install docker.io
、docker --help
、sudo docker info

  【2019-03-19更新】:更新安装docker过程中的命令

、sudo apt remove docker docker-engine docker.io containerd runc
、sudo apt update
、sudo apt install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
、curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
3.1、sudo apt-key fingerprint 0EBFCD88
、sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
、sudo apt update
、sudo apt install docker-ce docker-ce-cli containerd.io
、docker --help
、sudo docker info

  二、非“sudo”使用docker

  安装完docker之后,你会发现使用docker需要sudo权限,可不可以去掉呢?当然没问题。

  用户组和用户相关操作参考:https://www.linuxidc.com/Linux/2016-09/135626.htm

、docker info
、cat /etc/group
、sudo groupadd docker //如果不存在,创建docker用户组
、sudo gpasswd -a ${USER} docker
4.1、sudo gpasswd -dmyubuntu docker // 在用户中删除用户
、cat /etc/group
、systemctl restart docker
、docker info
、pkill x
、docker info

  三、安装mongodb

  mongodb的安装过程比较简单,比mysql简单多了,这里就不贴命令了,所以这篇文章才包含了其他的东西。到此结果。

最新文章

  1. If you really want to compile without asm, configure with --disable-asm.
  2. GIT在iOS开发中的使用
  3. WooCommerce微信支付插件免费版下载
  4. SQL的内连接与外连接
  5. 总结1-JMeter压力测试
  6. .jar是什么文件?(转载)
  7. C# 面向对象基础&封装&继承&多态&加深一下冒泡排序写法
  8. Tcpdump安装使用
  9. Django 2.0 学习(03):Django视图和URL(下)
  10. Powershell的IIS管理小结
  11. redis哨兵架构的基础知识及部署和管理
  12. GZip、deflate和sdch压缩(网摘整理)
  13. SV coverage
  14. MVC 5 Scaffolder + EntityFramework+UnitOfWork Pattern 代码生成工具集成Visual Studio 2013
  15. Bacterial Melee CodeForces - 756D (dp去重)
  16. Hash(MD5校验工具)
  17. Effect
  18. D. Monitor Educational Codeforces Round 28
  19. java动态代码的实现以及Class的卸载 (转至http://dustin.iteye.com/blog/46393)
  20. js通过生成临时表单再删除的方式向后台提交数据(模拟ajax的post提交但还要跳转页面不返回数据)以及 struts向前台返回文件下载及防止中文乱码处理

热门文章

  1. 我的秋招经验分享(已拿BAT头条网易滴滴)
  2. Java进阶篇设计模式之十二 ---- 备忘录模式和状态模式
  3. Pycharm:书签的使用
  4. php 通过header下载中文文件名 压缩包损坏或文件不存在的问题
  5. 企业微信快捷接入Odoo的模块——WeOdoo
  6. odoo:免费开源ERP入门与实践
  7. 一起学Android之Sqlite
  8. 章节十、7-Xpath---Xpath中绝对路径相对路径的区别
  9. .NET下的使用ActiveMQ
  10. FPGA高速ADC接口实战——250MSPS采样率ADC9481