一、基于commit命令创建

docker commit CONTAINER [REPOSITORY [:TAG]]

1、使用ubuntu镜像创建一个容器

docker run -it ubuntu /bin/bash

2、配置软件源

root@8bfbf48c59f8:/# cp /etc/apt/sources.list /etc/apt/sources.list.bak
root@8bfbf48c59f8:/# apt-get update
root@8bfbf48c59f8:/# apt-get install vim
root@8bfbf48c59f8:/# vim /etc/apt/sources.list //配置阿里云软件源
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
root@8bfbf48c59f8:/# apt-get update

3、安装和配置SSH服务

root@8bfbf48c59f8:/# apt-get install openssh-server
root@8bfbf48c59f8:/# mkdir -p /var/run/sshd
root@8bfbf48c59f8:/# /usr/sbin/sshd -D &
[]
root@8bfbf48c59f8:/# jobs
[]+ Running /usr/sbin/sshd -D &
root@8bfbf48c59f8:/# apt-get install net-tools
root@8bfbf48c59f8:/# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0.0.0.0: 0.0.0.0:* LISTEN /sshd
tcp6 ::: :::* LISTEN /sshd
root@8bfbf48c59f8:/# sed -ri 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd
root@8bfbf48c59f8:/# mkdir root/.ssh
root@8bfbf48c59f8:/# vim root/.ssh/authorized_keys
root@8bfbf48c59f8:/# vim /run.sh
#!/bin/bash
/usr/sbin/sshd -D
root@8bfbf48c59f8:/# chmod +x /run.sh
root@8bfbf48c59f8:/# exit

4、保存镜像

[root@CentOS702 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8bfbf48c59f8 ubuntu "/bin/bash" minutes ago Exited () seconds ago reverent_lumiere
05c71189c30e ubuntu "/bin/bash" hours ago Exited () hours ago wonderful_wright
387d42ee191b busybox "sh" hours ago Exited () hours ago priceless_wing
d91b7c33a198 training/webapp "python app.py" hours ago Up hours 0.0.0.0:->/tcp web
7e17a1d0cb21 training/postgres "su postgres -c '/..." hours ago Up hours /tcp db
[root@CentOS702 ~]# docker commit 8bfb sshd:ubuntu
sha256:34aafa7f58cae9f55bab2183f0c14dcc065dcfd3cc772115808e9c30d1680889
[root@CentOS702 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sshd ubuntu 34aafa7f58ca seconds ago MB
busybox latest c75bebcdd211 weeks ago 1.11 MB
haproxy latest c481d2544260 weeks ago MB
liuyongsheng614/test latest c400af73564b months ago MB
test latest c400af73564b months ago MB
ubuntu latest 0ef2e08ed3fa months ago MB
training/webapp latest 6fae60ef3446 years ago MB
training/postgres latest 6fa973bb3c26 years ago MB

5、使用镜像

[root@CentOS702 ~]# docker run -d -p : sshd:ubuntu /run.sh
d4ad0fcf769edf268854e7b5f1b0e62ed78a52b836cf3b2f4f1a97630835696e
[root@CentOS702 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d4ad0fcf769e sshd:ubuntu "/run.sh" seconds ago Up seconds 0.0.0.0:->/tcp cranky_stonebraker
d91b7c33a198 training/webapp "python app.py" hours ago Up hours 0.0.0.0:->/tcp web
7e17a1d0cb21 training/postgres "su postgres -c '/..." hours ago Up hours /tcp db
[root@CentOS702 ~]# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0.0.0.0: 0.0.0.0:* LISTEN /sshd
tcp 127.0.0.1: 0.0.0.0:* LISTEN /master
tcp6 ::: :::* LISTEN /docker-proxy
tcp6 ::: :::* LISTEN /sshd
tcp6 ::: :::* LISTEN /docker-proxy
[root@CentOS702 ~]# ssh 192.168.20.107 -p
The authenticity of host '[192.168.20.107]:10022 ([192.168.20.107]:10022)' can't be established.
ECDSA key fingerprint is c4:7d:d1:::a2:7a::::f7:::ed:7c:e7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.20.107]:10022' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 16.04. LTS (GNU/Linux 3.10.-514.10..el7.x86_64 x86_64) * Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law. root@d4ad0fcf769e:~# ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:04
inet addr:172.17.0.4 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:47 errors:0 dropped:0 overruns:0 frame:0
TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7349 (7.3 KB) TX bytes:6493 (6.4 KB) lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

二、使用Dockerfile创建

1、创建工作目录

[root@CentOS702 ~]# mkdir sshd_ubuntu
[root@CentOS702 ~]# cd sshd_ubuntu/
[root@CentOS702 sshd_ubuntu]# touch Dockerfile run.sh
[root@CentOS702 sshd_ubuntu]# ls
Dockerfile run.sh

2、编写run.sh脚本和authorized_keys文件

[root@CentOS702 sshd_ubuntu]# vim run.sh
#!/bin/bash
/usr/sbin/sshd -D
[root@CentOS702 sshd_ubuntu]# cat ~/.ssh/id_rsa.pub > authorized_keys

3、编写Dockerfile

[root@CentOS702 sshd_ubuntu]# vim Dockerfile
# 设置继承镜像
FROM ubuntu:latest # 提供一些作者的信息
MAINTAINER from www.speedlinux.cn by Release (@qq.com) # 下面开始运行命令,此处更改ubuntu的源为国内阿里云的源
RUN echo "# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted" > /etc/apt/sources.list
RUN echo "deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted" >>/etc/apt/sources.list
RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted" >>/etc/apt/sources.list
RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial universe" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse" >>/etc/apt/sources.list
RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties" >>/etc/apt/sources.list
RUN echo "deb http://archive.canonical.com/ubuntu xenial partner" >>/etc/apt/sources.list
RUN echo "deb-src http://archive.canonical.com/ubuntu xenial partner" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted" >>/etc/apt/sources.list
RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse" >>/etc/apt/sources.list
RUN apt-get update # 安装ssh服务
RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
RUN mkdir -p /root/.ssh # 取消pam限制
RUN sed -ri 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd # 复制配置文件到相应位置,并赋予脚本可执行权限
ADD authorized_keys /root/.ssh/authorized_keys
ADD run.sh /run.sh
RUN chmod /run.sh # 开放端口
EXPOSE # 设置自启动命令
CMD ["/run.sh"]

4、创建镜像

[root@CentOS702 sshd_ubuntu]# ls
authorized_keys Dockerfile run.sh
[root@CentOS702 sshd_ubuntu]# docker build -t sshd:dockerfile .
Sending build context to Docker daemon 6.656 kB
Step / : FROM ubuntu:latest
---> 0ef2e08ed3fa
Step / : MAINTAINER from www.speedlinux.cn by Release (@qq.com)
---> Running in 44882909365e
---> 8d50ef4f2875
Removing intermediate container 44882909365e
Step / : RUN echo "# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted" > /etc/apt/sources.list
---> Running in 0a3152990479
---> 1d3c31769bc0
Removing intermediate container 0a3152990479
Step / : RUN echo "deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties" >>/etc/apt/sources.list
---> Running in 8e19f8639f38
---> 4cc6a24ec929
Removing intermediate container 8e19f8639f38
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted" >>/etc/apt/sources.list
---> Running in 070e4db1acc1
---> 502c87d04907
Removing intermediate container 070e4db1acc1
Step / : RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties" >>/etc/apt/sources.list
---> Running in 6238dee9c025
---> 72b44efd5a2f
Removing intermediate container 6238dee9c025
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted" >>/etc/apt/sources.list
---> Running in 68523ca3d40a
---> 96e2b55b2e4a
Removing intermediate container 68523ca3d40a
Step / : RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties" >>/etc/apt/sources.list
---> Running in 0df0eb2c8e23
---> 266ecc8525ed
Removing intermediate container 0df0eb2c8e23
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial universe" >>/etc/apt/sources.list
---> Running in 325f1e6b1a1f
---> c9c8a4f2f79f
Removing intermediate container 325f1e6b1a1f
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe" >>/etc/apt/sources.list
---> Running in 087d9cadadf9
---> 4036f74f16d0
Removing intermediate container 087d9cadadf9
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse" >>/etc/apt/sources.list
---> Running in 28484ebf4379
---> 75f1731366c9
Removing intermediate container 28484ebf4379
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse" >>/etc/apt/sources.list
---> Running in 66a67ef0b576
---> ccc1b7f56d23
Removing intermediate container 66a67ef0b576
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse" >>/etc/apt/sources.list
---> Running in d29d31d63c6c
---> 16c956be72ba
Removing intermediate container d29d31d63c6c
Step / : RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties" >>/etc/apt/sources.list
---> Running in 87381cbe9dca
---> 3c9264c6b39f
Removing intermediate container 87381cbe9dca
Step / : RUN echo "deb http://archive.canonical.com/ubuntu xenial partner" >>/etc/apt/sources.list
---> Running in 398b91ef3ae5
---> e4f0621f0ef2
Removing intermediate container 398b91ef3ae5
Step / : RUN echo "deb-src http://archive.canonical.com/ubuntu xenial partner" >>/etc/apt/sources.list
---> Running in 461523f06aa0
---> 960544031c3c
Removing intermediate container 461523f06aa0
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted" >>/etc/apt/sources.list
---> Running in 8f8a3969969f
---> 1d2c9628b2a2
Removing intermediate container 8f8a3969969f
Step / : RUN echo "deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties" >>/etc/apt/sources.list
---> Running in eb72116f4998
---> 1ac2cb45d8b2
Removing intermediate container eb72116f4998
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe" >>/etc/apt/sources.list
---> Running in 1e5a3301eda9
---> c8925f180f39
Removing intermediate container 1e5a3301eda9
Step / : RUN echo "deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse" >>/etc/apt/sources.list
---> Running in c50e237ab54d
---> 4fe433abdb4c
Removing intermediate container c50e237ab54d
Step / : RUN apt-get update
--------此处省略部分内容---------
Step / : RUN mkdir -p /var/run/sshd
---> Running in 6317fd28784f
---> db6e02247a36
Removing intermediate container 6317fd28784f
Step / : RUN mkdir -p /root/.ssh
---> Running in a9c8f95ea325
---> 116fcfbb12fe
Removing intermediate container a9c8f95ea325
Step / : RUN sed -ri 's/session required pam_loginuid.so/#session required pam_loginuid.so/g' /etc/pam.d/sshd
---> Running in 4639a1286359
---> 1ba44701c688
Removing intermediate container 4639a1286359
Step / : ADD authorized_keys /root/.ssh/authorized_keys
---> 49b26370e4e1
Removing intermediate container 80eb3c62eb53
Step / : ADD run.sh /run.sh
---> e8bb99bff877
Removing intermediate container fffd66d00982
Step / : RUN chmod /run.sh
---> Running in 16ab718f15a3
---> 7ba5ff9e62a1
Removing intermediate container 16ab718f15a3
Step / : EXPOSE
---> Running in 025cb23da1eb
---> dc4d028afb5d
Removing intermediate container 025cb23da1eb
Step / : CMD /run.sh
---> Running in e744919eb6c9
---> 29b43626dfdc
Removing intermediate container e744919eb6c9
Successfully built 29b43626dfdc
[root@CentOS702 sshd_ubuntu]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sshd dockerfile 29b43626dfdc minutes ago MB
sshd ubuntu 34aafa7f58ca days ago MB
busybox latest c75bebcdd211 weeks ago 1.11 MB
haproxy latest c481d2544260 weeks ago MB
liuyongsheng614/test latest c400af73564b months ago MB
test latest c400af73564b months ago MB
ubuntu latest 0ef2e08ed3fa months ago MB
training/webapp latest 6fae60ef3446 years ago MB
training/postgres latest 6fa973bb3c26 years ago MB

5、测试镜像,运行容器

[root@CentOS702 sshd_ubuntu]# docker run -d -p : sshd:dockerfile
[root@CentOS702 sshd_ubuntu]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
618bff49cfc4 sshd:dockerfile "/run.sh" seconds ago Up seconds 0.0.0.0:->/tcp reverent_ride
[root@CentOS702 sshd_ubuntu]# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0.0.0.0: 0.0.0.0:* LISTEN /sshd
tcp 127.0.0.1: 0.0.0.0:* LISTEN /master
tcp6 ::: :::* LISTEN /sshd
tcp6 ::: :::* LISTEN /docker-proxy
[root@CentOS702 sshd_ubuntu]# ssh 192.168.20.107 -p
The authenticity of host '[192.168.20.107]:10022 ([192.168.20.107]:10022)' can't be established.
ECDSA key fingerprint is :8e:::1b:1a:a8:b6::4c:2a:8d:0b:::.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.20.107]:10022' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 16.04. LTS (GNU/Linux 3.10.-514.10..el7.x86_64 x86_64) * Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law. root@618bff49cfc4:~# ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:02
inet addr:172.17.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:152 errors:0 dropped:0 overruns:0 frame:0
TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:197733 (197.7 KB) TX bytes:18202 (18.2 KB) lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

创建支持SSH服务的镜像的更多相关文章

  1. 使用Dockerfile创建支持SSH服务的镜像

    1.前面我们学习了使用Dockerfile,那接下来我们就用Dockerfile创建一个支持SSH服务的镜像. 2.首先创建一个目录ssh_centos [root@rocketmq-nameserv ...

  2. ubuntu-docker入门到放弃(八)创建支持SSH服务的镜像

    我们知道进入docker容器可以使用attach.exec等命令来操作和管理,但是如果需要远程登录并管理容器,就需要ssh服务的支持了. 1.基于commit命令创建 docker提供了commit命 ...

  3. docker如何创建支持SSH服务的镜像

    一般情况下,Linux系统管理员通过SSH服务来管理操作系统,但Docker的很多镜像是不带SSH服务的,那么我们怎样才能管理操作系统呢?在第一部分中我们介绍了一些进入容器的办法,比如用attach. ...

  4. Docker(2):使用Dockerfile创建支持SSH服务的镜像

    1.创建工作目录 # mkdir sshd_ubuntu # ls 在其中,创建Dockerfile和run.sh文件 # cd sshd_ubuntu/ # touch Dockerfile run ...

  5. docker基于commit命令创建支持ssh服务的镜像

    以centos为基础,目的使用ssh服务远程连接docker容器. 环境:宿主机centos7(宿主机ip地址为192.168.164.130),直接搜索docker的centos镜像,下载最新版本. ...

  6. docker基于Dockerfile命令创建支持ssh服务的镜像

    首先,创建一个sshd_centos工作目录: [root@localhost ~]# mkdir sshd_centos [root@localhost ~]# cd sshd_centos [ro ...

  7. Docker创建支持ssh服务的容器和镜像

    原文链接:Docker创建支持ssh服务的容器和镜像 1. 这里使用的centos作为容器,所以首先下载centos的images # sudo docker pull centos 2. 下载后执行 ...

  8. Docker使用Dockerfile创建支持ssh服务自启动的容器镜像

    原文链接:Docker使用Dockerfile创建支持ssh服务自启动的容器镜像 1. 首先创建一个Dockerfile文件.文件内容例如以下 # 选择一个已有的os镜像作为基础 FROM cento ...

  9. 创建支持ssh服务的docker容器和镜像

    http://www.kongxx.info/blog/?p=57 1. 这里使用的centos作为容器,所以首先下载centos的imagessudo docker pull centos 2. 下 ...

随机推荐

  1. Mysql实战45讲 05讲深入浅出索引(下)极客时间 读书笔记

    极客时间 Mysql实战45讲 04讲深入浅出索引(下)极客时间 笔记体会: 回表:回到主键索引树搜索的过程,称为回表覆盖索引:某索引已经覆盖了查询需求,称为覆盖索引,例如:select ID fro ...

  2. 133.throw机制 抛出类类型

    #include <iostream> using namespace std; //try尝试执行,抛出throw,throw之后语句不再执行 //catch处理throw的异常 voi ...

  3. web.xml配置详解(转载)

    一.web.xml配置文件常用元素及其意义预览 1 <web-app> 2 3 <!--定义了WEB应用的名字--> 4 <display-name></di ...

  4. mysql表空间传输(ERROR 1808) row_format设置

    文章结构如下: 从MYSQL5.6版本开始,引入了传输表空间这个功能,可以把一张表从一个数据库移到另一个数据库或者机器上.迁移的时候很方便,尤其是大表. 由于本次达到测试使用版本5.6.38传到5.7 ...

  5. xBIM 高级03 更改日志创建

    系列目录    [已更新最新开发文章,点击查看详细]  模型中发生的每一个变化都是事务的一部分,这是我们设计的核心.所有事务都是由 IModel 的实现创建的,并且从中被弱引用,因此当使用 using ...

  6. WordPress开启伪静态

    一.NGINX 的话在 domain.conf 的 server 增加代码: location / { try_files $uri $uri/ /index.php?$args; } 如果使用的是 ...

  7. 图层Layers的介绍

    图层包含的要素可以是矢量形式的也可以是栅格形式的. 这里介绍其中一种:添加TileLayer.(加载Image类型的图层) 引用:"esri/layers/TileLayer" 举 ...

  8. mac同时享受教育优惠和免手续费分期

    神奇地址:工商银行  http://store.apple.com/cn_icbc_edu招商银行  http://store.apple.com/cn_cmb_edu农业银行  http://sto ...

  9. 紫书 例题 11-2 UVa 1395(最大边减最小边最小的生成树)

    思路:枚举所有可能的情况. 枚举最小边, 然后不断加边, 直到联通后, 这个时候有一个生成树.这个时候,在目前这个最小边的情况可以不往后枚举了, 可以直接更新答案后break. 因为题目求最大边减最小 ...

  10. 2015 Multi-University Training Contest 2 hdu 5308 I Wanna Become A 24-Point Master

    I Wanna Become A 24-Point Master Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 ...