docker 命令2
docker build -t dvm.adsplatformproxy:v1.0.0 . #build images
docker run -e WWNamespace=dev -e ZKServerAddress=****** -p 6000:80 6cb913a34ae3 #run container,本地起进程
docker run -ti 6cb913a34ae3 /bin/bash #远程进入image文件;exit退出
docker rmi -f b54d6e186ef4 #远程删除image
docker rmi -rf b54d6e186ef4
docker build -t dvm.adsplatformproxy:v1.0.0 . #build images
docker run -e WWNamespace=dev -e ZKServerAddress=****** -p 6000:80 6cb913a34ae3 #run container,本地起进程
docker run -ti 6cb913a34ae3 /bin/bash #远程进入image文件;exit退出
docker rmi -f b54d6e186ef4 #远程删除image
docker rmi -rf b54d6e186ef4
查看docker仓库的tag信息
For the latest (as of 2015-07-31) version of Registry V2, you can get this image from DockerHub:
docker pull distribution/registry:master
List all repositories (effectively images):
curl -X GET https://myregistry:5000/v2/_catalog
> {"repositories":["redis","ubuntu"]}
List all tags for a repository:
curl -X GET https://myregistry:5000/v2/ubuntu/tags/list
> {"name":"ubuntu","tags":["14.04"]}
kubectl get deployment #获取发布
kubectl delete deployment **** #删除发布,自动删除service、pods
kubectl create ******.yaml #创建yaml,包含config、ingress配置
kubectl get ingress #获取ingress配置
kubectl get configmap #获取config配置
kubectl edit configmaps *****-config -n *namespace*
kubectl get configmap #1.获取配置文件
kubectl edit configmap ****** #2.修改配置文件
..\refreshconfig.ps1 -ConfigMapName dvm-website-config #3.psl更新配置 或者删除已有的pod,会自动创建pod并使用新的configmap
kubectl create -f rc-nginx.yaml kubectl replace -f rc-nginx.yaml kubectl edit po rc-nginx-btv4j kubectl delete -f rc-nginx.yaml
kubectl delete po rc-nginx-btv4j
kubectl delete po -lapp=nginx-2 kubectl describe po rc-nginx-2-btv4j # kubectl get namespace
kubectl get po <podname> -o #yaml 以yawl格式输出pod的详细信息。
kubectl get po <podname> -o json # 以json格式输出pod的详细信息。
kubectl get po rc-nginx-2-btv4j -o=custom-columns=LABELS:.metadata.labels.app #使用”-o=custom-columns=“定义直接获取指定内容的值
configmap 的更新
A new command, kubectl rolling-restart
that takes an RC name and incrementally deletes all the pods controlled by the RC and allows the RC to recreate them.
Small work around (I use deployments and I want to change configs without having real changes in image/pod):
- create configMap
- create deployment with ENV variable (you will use it as indicator for your deployment) in any container
- update configMap
- update deployment (change this ENV variable)
k8s will see that definition of the deployment has been changed and will start process of replacing pods
PS:
if someone has better solution, please share
It feels like the right solution here would enable you to restart a deployment, and reuse most of the deployment parameters for rollouts like MinReadyCount, while allowing for command-line overrides like increasing the parallelism for emergency situations where you need everything to bounce immediately.
We would also like to see this for deployments maybe like kubectl restart deployment some-api
Kubernetes is allowed to restart Pods for all sorts of reasons, but the cluster admin isn't allowed to.
I understand the moral stand that 'turn it off and on again' may not be a desired way to operate... but I also think it should be ok to let those people who wish to, to restart a Deployment without resorting to the range of less appetizing tricks like:
- deleting pods
- dummy labels
- dummy environment variables
- dummy config maps mapped to environment variable
- rebooting the worker nodes
- cutting the power to the data centre
docker 命令2的更多相关文章
- Docker命令学习
今天更换腾讯云系统的时候发现了多了个CoreOS,据说是专门运行docker的轻量系统,顺便学习一下docker命令. 1. docker version 显示 Docker 版本信息. 2. doc ...
- Docker命令详解
Docker命令详解 最近学习Docker,将docker所有命令实验了一番,特整理如下: # docker --help Usage: docker [OPTIONS] COMMAND [arg ...
- Docker入门教程(六)另外的15个Docker命令
Docker入门教程(六)另外的15个Docker命令 [编者的话]DockerOne组织翻译了Flux7的Docker入门教程,本文是系列入门教程的第六篇,继续介绍Docker命令.之前的第二篇文章 ...
- 安装Docker和下载images镜像和常用Docker命令
我的是centos7,也会6的方法: $sudo yum install docker 直接yum安装contos7使用centos6.5先获取epel源并 启动Docker,并注册开机服务 [roo ...
- docker命令和后台参数
Docker官方为了让用户快速了解Docker,提供了一个 交互式教程 ,旨在帮助用户掌握Docker命令行的使用方法. Docker 命令行 下面对Docker的命令清单进行简单的介绍,详细内容在后 ...
- 掌握Docker命令
1.管理镜像命令 获取镜像 docker push ubuntu:14:04 查看镜像列表 docker images 重命名image docker tag IMAGE-NAME NEW-IMAGE ...
- docker命令不需要敲sudo的方法
由于docker daemon需要绑定到主机的Unix socket而不是普通的TCP端口,而Unix socket的属主为root用户,所以其他用户只有在命令前添加sudo选项才能执行相关操作. 如 ...
- 从开发到部署会用到的 Docker 命令
本文的目的是理解容器开发在目标环境中部署的端到端流程,并列出这些操作所需的 Docker 命令.如果有任何Docker问题,请移步到最新最热的技术社区 IT帮 itbang.me 提问,短信通知专家来 ...
- docker命令行学习
docker命令行学习 docker run docker run --help:老实说这条最管用了 docker run -it:交互模式,允许控制台输出 docker run -d:detach, ...
- Docker命令查询
基本语法 docker [OPTIONS] COMMAND [arg...] 一般来说,Docker 命令可以用来管理 daemon,或者通过 CLI 命令管理镜像和容器.可以通过 man docke ...
随机推荐
- Linux Shell入门
转自:http://www.mamicode.com/info-detail-605431.html
- 通过Hive将数据写入到ElasticSearch
我在<使用Hive读取ElasticSearch中的数据>文章中介绍了如何使用Hive读取ElasticSearch中的数据,本文将接着上文继续介绍如何使用Hive将数据写入到Elasti ...
- python添加新的模块
添加新的模块可以把路径放到环境变量中 或者放到site-packages文件夹下
- 20165215 实验一 Java开发环境的熟悉
20165215 实验一 Java开发环境的熟悉 一.实验报告封面 课程:Java程序设计 班级:1652班 姓名:张家佳 学号:20165215 指导教师:娄嘉鹏 实验日期:2018年4月2日 实验 ...
- Spring Batch 远程分区和远程分块的区别
Partitioning is a master/slave step configuration that allows for partitions of data to be processed ...
- [转载]localStorage使用总结
一.什么是localStorage.sessionStorage 在HTML5中,新加入了一个localStorage特性,这个特性主要是用来作为本地存储来使用的,解决了cookie存储空间不足的问题 ...
- Django后端项目----RESTful API
一. 什么是RESTful REST与技术无关,代表的是一种软件架构风格,REST是Representational State Transfer的简称,中文翻译为“表征状态转移” REST从资源的角 ...
- ogg 12.3 中 format release的变化
Non-CDB databases with compatibility set to 12.1, FORMAT RELEASE 12.2 or above is supported. Non-CDB ...
- logger日志模块
简单配合模式: import logging#简单配置logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s ...
- The logback manual #02# Architecture
索引 Logback's architecture Logger, Appenders and Layouts Effective Level(有效等级)又名Level Inheritance Ret ...
- Docker命令学习