docker file cheat sheet

Version 0.0.1

FROM ubuntu:16.04

RUN apt-get update; apt-get install -y nginx
RUN echo 'hi, i am here' > /var/www/html/index.html

ADD latest.tar.gz /var/www/wordpress
COPY somefile /var/some_place/ #compare to ADD, no magic
VOLUME ["/opt/project", "/data"]
USER user:group
ARG webapp_user=user
LABEL location="Shanghai" type="ep" //add image metadata

ENTRYPOINT ["/usr/local/bin/", "-g"] #docker run command will be as argument for this
CMD ["/usr/local/bin/", "-l"] #only the last one works,and maybe override by docker run
#docker run --entrypoint 可以覆盖ENTRYPOINT, docker run 后边的command可以覆盖 CMD,如果有entrypoint, cmd 做参数

关于 ip tunnel 端口转发

The AllowTcpForwarding option in the OpenSSH server configuration file must be enabled on the server to allow port forwarding. By default, forwarding is allowed.

local forwarding:
$ ssh -L
$ ssh -L

remote forwarding:
$ ssh -R 8080:localhost:80
$ ssh -R
$ ssh -R -R

about SOCKS 协议

SOCKS: Socket Secure. OSI 模型的第五层, 提供代理服务, tcp, 默认1080端口, 提供用户名密码认证. SOCK4, SOCK5 2个版本.

about httpclient timeout
Oracle Java parameters

Returns the timeout in milliseconds used when requesting a connection from the connection manager.

Determines the timeout in milliseconds until a connection is established.

Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets). (default: -1) (default: -1)

These properties specify the default connect and read timeout (resp.) for the protocol handler used by specifies the timeout (in milliseconds) to establish the connection to the host. For example for http connections it is the timeout when establishing the connection to the http server. For ftp connection it is the timeout when establishing the connection to ftp servers. specifies the timeout (in milliseconds) when reading from input stream when a connection is established to a resource.