分类 默认分类 下的文章

docker command cheat sheet

to check docker installed or not

$ docker -v
$ docker info

how to start docker daemon

1. Add the user to the docker group.

$ sudo usermod -aG docker $(whoami)

2. Log out and log back in to ensure docker runs with correct permissions.

3. Start docker.

$ sudo service docker start

$ docker login localhost:8080 //docker login [OPTIONS: -u, -p] [SERVER]
$ docker logout localhost:8080

$ docker commit container_id repo:tag //get container id from docker ps -l -q
$ docker commit -m 'message' -a '[email protected]' container_id repo:tag

$ docker build -t="repo/name:tag" .
$ docker build -t="repo/name" /path/to/file
$ docker build --no-cache -t="repo/name" .

$ docker images -a //list all images
$ docker images [REPOSITORY[:TAG]] //list bye repo and tag
$ docker images --no-trunc //list full image id

$ docker history image_id

$ docker rmi image_id

$ docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
$ docker run -i -t 8dbd9e392a96 /bin/bash
$ docker run --name eric -d -p 8080:80 image_id
$ docker run --restart=always image_id
$ docker run --restart=on-failure:5 image_id //non-zero exit, max retry 5

$ docker start container_id
$ docker restart container_id
$ docker stop container_id
$ docker kill container_id

$ docker attach container_id

$ docker exec -i -t 8dbd9e392a96 /bin/bash
$ docker exec -d container_id apt-get update

$ docker ps -a
$ docker ps -l n

$ docker rm [container_id or container_name]
$ docker rm -f docker ps -a -q

$ docker logs -f container_id
$ docker logs -f --tail 30 container_id

$ docker top container_id

$ docker stats container_id1 ...

$ docker inspect container_id
$ docker inspect --format '{{.NetworkSetting.IPAddress}}' container_id

$ docker port container_id

in linux, all the docker info are in folder : /var/lib/docker/

英语

Plain vanilla is an adjective describing the simplest version of something, without any optional extras, by analogy with vanillaice cream, the default flavour.

DNS some keywords

  1. Name servers host a domain’s DNS information in a text file called the zone file. They’re are also known as **Servers of
    Authority (SOAs)**
  2. On Linux (and probably most Unix), there is no OS-level DNS caching unless nscd is installed and running. Even then, the DNS caching feature of nscd is disabled by default at least in Debian because it's broken. The practical upshot is that your linux system very very probably does not do any OS-level DNS caching.
  3. An AAAA record is just like an A record, but for IPv6 IP addresses. A typical AAAA record looks like the following:

参考 https://www.linode.com/docs/networking/dns/dns-records-an-introduction

涉及 IBM 的J9 JVM 的三种 dump 类型

Memory Analyzer can currently work with three dump types:

  1. IBM Portable Heap Dump (PHD): This proprietary IBM format contains
    only the type and size of each Java object in the process, and the
    relationships among the objects. This dump-file format is
    significantly smaller than the other formats and contains the least
    information. The data is usually sufficient, though, for diagnosing
    memory leaks and getting a basic understanding of the application's
    architecture and footprint.
  2. HPROF binary dump: The HPROF binary format contains all the data
    present in the IBM PHD format as well as the primitive data held
    inside the Java objects, and the thread details. You can look at the
    values held in fields inside the objects and see which methods were
    being executed at the time the dump was taken. The additional
    primitive data makes HPROF dumps significantly larger than
    PHD-format dumps; they are approximately the same size as the used
    Java heap.
  3. IBM system dumps: When the IBM Java runtime is being used, the
    native operating-system dump file — a core file on AIX® or Linux, a
    minidump on Windows®, or a SVC dump on z/OS®— can be loaded into
    Memory Analyzer. These dumps contain the entire memory image of the
    running application — all the information and data in the HPROF
    format, as well as all of the native-memory and thread information.
    This is the largest and most comprehensive dump-file format.

Both IBM dump types are available only with the Diagnostic Tool Framework for Java (DTFJ) plug-in installed

节选自: https://www.ibm.com/developerworks/library/j-memoryanalyzer/#table1