利用docker制作一个带有redis软件的镜像,供其他人使用

1. 宿主机在etc/apt/下创建一个haha的文件夹

2.宿主机将haha文件夹映射到容器的虚拟系统中etc/apt/

3. 此时,可以在宿主机和容器虚拟机中同步创建和删除文件

4. 将宿主机中的source.list文件同步到容器浏览器中。

4.1 更新前容器虚拟机中的更新源

4.2 同步替换后的更新源

4.2.1 宿主机将sources.list拷贝到同步文件夹

4.2.2 容器虚拟机从同步文件夹中将sources.list拷贝到对应位置,覆盖掉原来的sources.list

4.2.3 容器虚拟机更新源

apt-get update

报错:Is the package apt-transport-https installed?

安装:apt-get install apt-transport-https 依然报同样的错

报错:Unable to locate package apt-transport-https

原因:sources.list 问题,换成清华园的sources.list即可,直接更新。

 1 # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
 2 deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted #Added by software-properties
 3 
 4 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
 5 # newer versions of the distribution.
 6 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
 7 deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse universe #Added by software-properties
 8 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
 9 
10 ## Major bug fix updates produced after the final release of the
11 ## distribution.
12 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
13 deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse restricted universe main #Added by software-properties
14 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
15 
16 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
17 ## team, and may not be under a free licence. Please satisfy yourself as to
18 ## your rights to use the software. Also, please note that software in
19 ## universe WILL NOT receive any review or updates from the Ubuntu security
20 ## team.
21 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
22 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
23 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
24 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
25 
26 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
27 ## team, and may not be under a free licence. Please satisfy yourself as to 
28 ## your rights to use the software. Also, please note that software in 
29 ## multiverse WILL NOT receive any review or updates from the Ubuntu
30 ## security team.
31 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
32 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
33 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
34 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
35 
36 ## N.B. software from this repository may not have been tested as
37 ## extensively as that contained in the main release, although it includes
38 ## newer versions of some applications which may provide useful features.
39 ## Also, please note that software in backports WILL NOT receive any review
40 ## or updates from the Ubuntu security team.
41 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
42 deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
43 # deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
44 
45 ## Uncomment the following two lines to add software from Canonical's
46 ## 'partner' repository.
47 ## This software is not part of Ubuntu, but is offered by Canonical and the
48 ## respective vendors as a service to Ubuntu users.
49 # deb http://archive.canonical.com/ubuntu xenial partner
50 # deb-src http://archive.canonical.com/ubuntu xenial partner
51 
52 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
53 deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse restricted universe main #Added by software-properties
54 # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
55 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
56 # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
57 deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
58 # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
View Code

apt-get update 

 

posted @ 2019-07-23 14:39  张京墨  阅读(881)  评论(0编辑  收藏  举报