站内公告:

我们的虚拟社区正式开通了

Main Menu

最新帖子

#91
Docker / docker离线安装
上次发布者 jvip_chen - 2022-1月-14 09:44 上午
有时候docker运行环境连不了互联网,怎么安装呢?这里介绍docker 离线安装方法,非常简单,只需要一个下载包和几个命令就能搞好!

1、去官网下载docker 安装二进制包,选择适合自己的版本。这里下载的是docker-19.03.9.tgz,在centos7中安装(cento6无法使用,提示linux版本内核版本太低)

下载地址:https://download.docker.com/linux/static/stable/x86_64/

2、复制docker-19.03.9.tgz到服务器上,解压:tar xzvf docker-19.03.9.tgz

3、进入docker目录复制所有文件到/usr/bin目录下,目的/user/bin是环境变量目录,在路径下都可以运行docker命令
ls -l docker
cp docker/* /usr/bin/
[root@localhost local]# tar xvf docker-19.03.9.tgz
docker/
docker/docker-init
docker/runc
docker/docker
docker/docker-proxy
docker/containerd
docker/ctr
docker/dockerd
docker/containerd-shim
[root@localhost local]# ls -l docker
total 195504
-rwxr-xr-x. 1 lr lr 32751272 May 14 17:29 containerd
-rwxr-xr-x. 1 lr lr  6012928 May 14 17:29 containerd-shim
-rwxr-xr-x. 1 lr lr 18194536 May 14 17:29 ctr
-rwxr-xr-x. 1 lr lr 61113382 May 14 17:29 docker
-rwxr-xr-x. 1 lr lr 68874208 May 14 17:29 dockerd
-rwxr-xr-x. 1 lr lr  708616 May 14 17:29 docker-init
-rwxr-xr-x. 1 lr lr  2928514 May 14 17:29 docker-proxy
-rwxr-xr-x. 1 lr lr  9600696 May 14 17:29 runc
[root@localhost local]# mv docker/* /usr/bin/
[root@localhost local]#
vim /etc/systemd/system/docker.service
添加文件内容:
[Unit]

Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
 
[Install]
WantedBy=multi-user.target

赋执行权限
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
#开机启动
systemctl enable docker.service
启动docker
systemctl start docker
#92
在封装系统时,无论使用哪种方法,必会使用C:\Windows\System32\sysprep下的sysprep.exe进行封装。运行这个程序时会出现两种选择:1.进入系统全新体验(OOBE);2.进入审核模式。这两种有什么不同呢?请先看下面的例子——

例1.使用原版镜像进行安装系统,到达输入"用户名"时,不要输入,按下Ctrl+Shift+F3快捷键组合,即可直接进入"审核模式",到达桌面后会自动弹出sysprep.exe运行窗口。在这个模式(默认为管理员账户)下可以进行安装软件,驱动等。
例2.在安装完成的系统里,运行sysprep.exe,选择"进入审核模式",重启后和例1情况一样。
例3.在安装完成的系统里,运行sysprep.exe,选择"进入系统全新体验(OOBE)",重启后又到达了输入"用户名"的地方。
简要说明:OEM厂商在预装系统时进入"审核模式",安装软件及驱动等,作为测试。通常购买品牌电脑时,第一次开机会出现:正在为首次使用系统做准备。。。然后设置用户名等,其实系统早已安装到位,就差最后一步,通过上面的说明应该很清楚这是怎么做到的了。通常我们在做封装系统时,都是选用"进入系统全新体验(OOBE)","审核模式"对于普通用户来说没有必要也没有什么特别的好处,相反每次开机还有窗口弹出。
#93
打开"控制面板",
进入控制面板,点击右上角,选择查看方式为大图标,找到设备管理器。
找到网络适配器,选择本地连接的网卡,右键,选择属性。
标题栏上面,切换到电源管理,取消勾选"允许计算机关闭此设备以节约电源"。点击确定。
#94
multipass / 下面是Multipass如何处理主实例的一个演示:
上次发布者 cloud - 2022-1月-06 06:05 下午
下面是Multipass如何处理主实例的一个演示:
multipass set client.primary-name=first
$ multipass start
Launched: first
Mounted '/home/ubuntu' into 'first:Home'
$ multipass stop
$ multipass launch eoan
Launched: calm-chimaera
$ multipass set client.primary-name=calm-chimaera
$ multipass suspend
$ multipass set client.primary-name=chopin
$ multipass start
Launched: chopin
Mounted '/home/ubuntu' into 'chopin:Home'
$ multipass list
Name                    State             IPv4             Image
chopin                  Running           10.122.139.63    Ubuntu 18.04 LTS
calm-chimaera           Suspended         --               Ubuntu 19.04
first                   Stopped           --               Ubuntu 18.04 LTS
#95
multipass / 如何启动LTS实例
上次发布者 cloud - 2022-1月-06 05:18 下午
The first five minutes with Multipass let you know how easy it is to have a lightweight cloud handy. Let's launch a few LTS instances, list them, exec a command, use cloud-init and clean up old instances to start.

Launch an instance (by default you get the current Ubuntu LTS)

multipass launch --name foo
Run commands in that instance, try running bash (logout or ctrl-d to quit)

multipass exec foo -- lsb_release -a
Pass a cloud-init metadata file to an instance on launch. See using cloud-init with multipass for more details

multipass launch -n bar --cloud-init cloud-config.yaml
See your instances

multipass list
Stop and start instances

multipass stop foo bar
multipass start foo
Clean up what you don't need

multipass delete bar
multipass purge
Find alternate images to launch with multipass

multipass find
Get help

multipass help
multipass help <command>
Now don't forget you still have 'foo' running. To learn more about Multipass keep
#96
multipass / 安装Multipass
上次发布者 cloud - 2022-1月-06 05:13 下午
Install Multipass on Linux
sudo snap install multipass
Install Multipass on MacOS
Download Multipass for MacOS

Run the installer in an account with Administrator privileges.

If you'd like to use Multipass with VirtualBox use this terminal command:

sudo multipass set local.driver=virtualbox
Install Multipass on Windows
Download Multipass for Windows
Note: You need Windows 10 Pro/Enterprise/Education v 1803 or later, or any Windows 10 with VirtualBox

Make sure your network is private or Windows prevents Multipass from starting.

Run the installer. You need to allow the installer to gain Administrator privileges.
#97
HTML/CSS开发技术 / bootstrap table中td内容设置不换行
上次发布者 jvip_chen - 2022-1月-05 06:25 下午
bootstrap table中td内容设置不换行

/*表格内容滚动,不换行显示*/

td{
    white-space:nowrap;
    overflow:hidden;
    word-break:keep-all;
}
/*表格宽度不改变,多出的不显示*/


table{
    table-layout:fixed;
}
#98
HTML/CSS开发技术 / Bootstrap table th td 实现文字垂直居中
上次发布者 jvip_chen - 2022-1月-05 06:24 下午
直接复写th、td的样式,样式代码如下(外联):

.table th, .table td {
text-align: center;
vertical-align: middle!important;
}
也可直接写在html的th, .table, td标签的style中,如下:

<th style="vertical-align: middle !important;text-align: center;">xxx</th>
<td style="vertical-align: middle !important;text-align: center;">xxx</td>
这样就能达到水平且垂直居中的效果了