By accessing the website and accepting the Cookie Policy, you agree to use the cookies provided by the Site in accordance with to analyze traffic, remember your preferences, and optimize your experience.

分类 - Debian

2018-11-24 15:17:45    249    0    0

狠狠地卸载

 apt-get autoremove apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-python -y
Docker    2018-11-23 17:07:33    677    0    0
apt-get install apt-transport-https dirmngr

添加 Docker 的库到 Debian 9 的 /etc/apt/sources.list

echo 'deb https://apt.dockerproject.org/repo debian-stretch main' >> /etc/apt/sources.list

可以用 cat 命令看一下

Docker    2018-11-23 17:07:33    137    0    0
  1. Run this command to download the latest version of Docker Compose:

    sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local
Docker    2018-11-23 17:07:33    191    0    0

一、基本概念

1. 什么是Docker

...

2. Docker的基本概念

  • 镜像(Image)

是一个只读模板,用来运行Docker容器。

  • 容器(Container)

负责应用程序的运行,包括操作系统、用户添加的文件以及元数据
容器是从镜像创建的运行实例。它可以被启动、开始、停止、删除。每个容器都是相互隔离的、保证安全的平台。

注:镜像是只读的,容器在启动的时候创建一层可写层作为最上层。

  • 仓库(Repository)

仓库是集中存放镜像文件的场所。
仓库分为公开仓库(Public)和私有仓库(Private)两种形式。

注:Docker 仓库的概念跟 Git 类似,注册服务器可以理解为 GitHub 这样的托管服务

二、快速开始

1. 安装

# ubuntu
curl -fsSL https://get.docker.com/ | sh
sudo service docker restart

2. 镜像

获取

# 从仓库注册服务器拉取
sudo docker pull ubuntu:14.04  # 官方仓库注册服务器,相当于 sudo docker pull registry.hub.docker.com/ubuntu:14.04
# 也可使用其他仓库,如: sudo docker pull dl.dockerpool.com:5000/ubuntu:12.04

显示

sudo docker images

运行

sudo docker run -t -i ubuntu:14.04 /bin/bash

修改

# 运行容器bash,通过shell进行操作
sudo docker run -t -i ubuntu:14.04 /bin/bash

# 提交更新
sudo docker commit -m "Added json gem" -a "Docker Newbee" 0b2616b0e5a8 ouruser/sinatra:v2
  • -m: 提交信息
  • -a: 指定更新的用户信息
  • 0b2616b0e5a8: 容器的 ID
  • ouruser/sinatra: 仓库名
  • v2: 仓库tag

创建

  1. 通过修改已有image, 具体操作修改中已有

  2. 通过Dockerfile来创建

mkdir mydockerimg

# docker image的配置文件
vim Dockerfile

# 创建image
sudo docker build
Docker    2018-11-23 17:07:33    227    0    0

这些命令总是记不住,或者说不用心去记,所以记录在本文中,以便将来查询。

列出所有的容器 ID

docker ps -aq

停止所有的容器

docker stop $(docker ps -aq)

删除所有的容器


docker rm $(docker ps -aq) ​

删除所有的镜像

docker rmi $(docker images -q)

复制文件

bbr ovz openvz    2018-11-23 17:07:33    113    0    0

安装:

wget https://raw.githubusercontent.com/kuoruan/shell-scripts/master/ovz-bbr/ovz-bbr-installer.sh --no-check-certificate 
chmod +x ovz-bbr-installer.sh 
./ovz-bbr-installer.sh

firewalld:

systemctl disable firewalld 
systemctl stop firewalld

卸载:

      ./ovz-bbr-installer.sh uninstall

多端口:

      vim /usr/local/haproxy-lkl/etc/port-rules

启动、停止、重启:

systemctl {start|stop|restart} haproxy-lkl
service haproxy-lkl {start|stop|restart}

更新 glibc:

wget http://ftp.redsleeve.org/pub/steam/glibc-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/glibc-common-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/glibc-devel-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/glibc-headers-2.15-60.el6.x86_64.rpm \
http://ftp.redsleeve.org/pub/steam/nscd-2.15-60.el6.x86_64.rpm
​
rpm -Uvh glibc-2.15-60.el6.x86_64.rpm \
glibc-common-2.15-60.el6.x86_64.rpm \
glibc-devel-2.15-60.el6.x86_64.rpm \
glibc-headers-2.15-60.el6.x86_64.rpm \
nscd-2.15-60.el6.x86_64.rpm

手动编译:

wget http://ftp.gnu.org/gn
2018-11-23 17:07:33    166    0    0

介绍

Debian 9 已经稳定好几个月了,可以作为生产环境使用了。下面将介绍,如何免使用格式化,直接通过 dist-upgrade 的方式直接升级至 Debian 9。

首先注意,您的系统上的,通过自编译生成的二进制程序,例如 PHP、Nginx 等,升级后可能无法使用,请在升级之后,重新编译它们。

建议您先在测试环境上测试您的生产工具完全可用后,再执行升级。

升级步骤

以下步骤