分类 默认分类 下的文章

docker 常用命令

镜像类

docker build --rm=true . 构建镜像
docker pull ${IMAGE} 安装镜像
docker images 显示已经安装的镜像
docker images --no-trunc 显示已经安装镜像的详细内容
docker rmi ${IMAGE_ID} 删除指定镜像
docker rmi $(docker images | grep 'none' | awk '{print $3}') 删除所有没有标签的镜像
docker rm $(docker ps -aq) 删除所有的镜像
docker rmi $(docker images --quiet --filter "dangling=true") 删除未使用的镜像

容器类

docker run 运行容器  docker run -d -p 主机端口1:容器端口1 主机端口2:容器端口2
docker ps 显示正在运行的容器
docker ps -a 显示所有的容器
docker stop ${CID} 停止指定容器
docker stop docker ps -q 停止所有正在运行的容器
docker ps -a --filter "exited=1" 显示所有退出状态为1的容器
docker rm ${CID} 删除指定容器
docker rm -fv ${CID} 彻底清除指定容器
docker ps -a | grep wildfly | awk '{print $1}' | xargs docker rm -f 使用正则表达式删除容器
docker rm -f $(docker ps -a | grep Exit | awk '{ print $1 }') 删除所有退出的容器
docker rm $(docker ps -aq) 删除所有的容器
docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID} 显示指定容器的IP
docker attach ${CID} 进入容器
docker exec -it ${CID} bash 进入容器打开一个shell
docker ps | grep wildfly | awk '{print $1}' 通过正则表达式查找容器的镜像ID

docker volume ls 查看所有卷标
docker volume inspect ${vagrant_name} 查看具体的volume对应的真实地址

docker system df -v 命令,类似于 Linux上的 df 命令,用于查看 Docker 的磁盘使用情况

docker system prune : 可以用于清理磁盘,删除关闭的容器、无用的数据卷和网络,以及 dangling 镜像(即无 tag 的镜像)。 
docker system prune -a : 清理得更加彻底,可以将没有容器使用 Docker镜像都删掉。 注意,这两个命令会把你暂时关闭的容器,以及暂时没有用到的 Docker 镜像都删掉了。 

docker-compose up -d

iis urlrewrite 内置变量

如果url为: http://www.mysite.com/content/default.aspx?tabid=2&subtabid=3

以下下是条件,iis内置的变量

{URL}          匹配 content/default.aspx

{QUERY_STRING}    匹配 tabid=2&subtabid=3

{HTTP_HOST}     匹配 www.mysite.com

{SERVER_PORT}    匹配 80

{SERVER_PORT_SECUR} The SERVER_PORT_SECURE server variable contains 0 and HTTPS contains OFF.

{REQUEST_URI}    匹配 content/default.aspx?tabid=2&subtabid=3

参考:

CACHE_URL
DOCUMENT_ROOT
HTTP_URL
HTTP_HOST
PATH_INFO
PATH_TRANSLATED
QUERY_STRING
REQUEST_FILENAME
REQUEST_URI
SCRIPT_FILENAME
SCRIPT_NAME
SCRIPT_TRANSLATED
UNENCODED_URL
URL
URL_PATH_INFO
APP_POOL_ID
APPL_MD_PATH
APPL_PHYSICAL_PATH
GATEWAY_INTERFACE
SERVER_SOFTWARE
SSI_EXEC_DISABLED

SERVER_PORT

plus地图(能显示,还不完善)

import { Component, ViewChild, ElementRef } from '@angular/core';

import { ConferenceData } from '../../providers/conference-data';
import { Dialogs } from 'ionic-native';
import { Platform } from 'ionic-angular';
import { Plus } from '../../providers/plus';


@Component({
  selector: 'page-map',
  templateUrl: 'map.html'
})
export class MapPage {
    plus: any;
    @ViewChild('mapCanvas') mapElement: ElementRef;/*通过模版变量注入,但类型是元素类型*/
    constructor(public confData: ConferenceData, public platform: Platform, plus: Plus) {
        this.platform.ready().then((readySource) => {
            this.plus = plus.plus;
      // Platform now ready, execute any required native code
    });
  }
    mapEle: any;
  ionViewDidLoad() {
      //this.baidumap();
      this.confData.getMap().subscribe(mapData => {
          this.mapEle = this.mapElement.nativeElement;//*拿到原生dom元素,然后,开始干活*/
          this.locate();    
      });

    }
  map: any;
  locate() {
      //let wo = ws.opener();
      //高德地图坐标为(116.3974357341,39.9085574220), 百度地图坐标为(116.3975,39.9074)
      let pcenter = new this.plus.maps.Point(116.3975, 39.9074);
      setTimeout(() => {
          this.map = new this.plus.maps.Map(this.mapEle.id);
          this.map.centerAndZoom(pcenter, 12);
          this.createMarker();
          // 创建子窗口
          //this.createSubview();
      }, 1000);
  }
     createMarker() {
              //高德地图坐标为(116.3406445236,39.9630878208), 百度地图坐标为(116.347292,39.968716
         let marker = new this.plus.maps.Marker(new this.plus.maps.Point(116.347292, 39.968716));
              //marker.setIcon("/logo.png");
         marker.setLabel("HBuilder");
         var bubble = new this.plus.maps.Bubble("打造最好的HTML5移动开发工具");
              marker.setBubble(bubble);
              this.map.addOverlay(marker);
          }
 //createSubview() {
 //    // 创建加载内容窗口
 //             let topoffset: string = '44px';
 //             if (plus.plus.navigator.isImmersedStatusbar()) {// 兼容immersed状态栏模式
 //                 topoffset = (Math.round(plus.plus.navigator.getStatusbarHeight()) + 44) + 'px';
 //             }
 //             var wsub = plus.plus.webview.create('maps_map_sub.html', 'sub', { top: topoffset, height: '60px', position: 'absolute', scrollIndicator: 'none', background: 'transparent' });
 //             plus.plus.webview.currentWebview().append(wsub);
 //         }
}

PC浏览器中没有plus对象

import { Injectable } from '@angular/core';

declare var window: any;

@Injectable()
export class Plus {

plus: any;
constructor() {
    **this.plus = window.plus == undefined ? null : window.plus;**

}

/**
 * 消息提醒
 * @param msg 消息
 */
toast(msg) {
    **if (this.plus)** {
        this.plus.nativeUI.toast(msg, { duration: "long" });
    } else
    {
        alert(msg)
    }
}

}