Skip to content

Commit

Permalink
pg
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuehui Ye committed Dec 11, 2019
1 parent e851527 commit 6d87d93
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
2 changes: 1 addition & 1 deletion post/arch/docker-.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ remove all images
docker rmi $(docker images -q) --force

#### Unable to remove filesystem
If you get such error:
If you encounter this problem

Unable to remove filesystem: /var/lib/docker/container/11667ef16239.../

Expand Down
22 changes: 20 additions & 2 deletions post/arch/docker-image-.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Mac OSX Image 不可以修改路径:
docker search httpd
docker run httpd

### check image exists

if [[ "$(docker images -q myimage:mytag 2> /dev/null)" == "" ]]; then
# do something
fi

## list image layer

$ docker history python:3.7
Expand Down Expand Up @@ -123,17 +129,29 @@ docker import理解为将外部文件复制进来形成只有一层文件系统
FROM centos:6.7
MAINTAINER Fisher "fisher@sudops.com"

### USER
USER root

### COPY and WORKDIR
WORKDIR 相当于cd

COPY . /app
WORKDIR /app

COPY 与linux copy 是一样的
COPY 中文件夹要带`/`

# 错误用法:COPY package.json /app
# app是文件:
COPY package.json /app
# app是目录:
COPY package.json /app/

COPY 中文件夹, 不带文件名本身

# copy -r /app/dist/ .
COPY --from=build-dist /app/dist .
# copy -r /app/dist .
COPY --from=build-dist /app/dist ./dist

### build options
--cpu-shares :设置 cpu 使用权重;
--cpu-period :限制 CPU CFS周期;
Expand Down
20 changes: 15 additions & 5 deletions post/c/shell-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,31 @@ CST是时区缩写,可以指下列的时区:
Send packet CA->Netherlands->CA .... 150,000,000 ns = 150 ms

# 时区设定:
全局
## 全局

echo 'Asia/Beijing' | sudo tee /etc/timezone
# 或者
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
dpkg-reconfigure -f noninteractive tzdata

局部
docker 设置时区

# 注意,Debian Stretch 版本后需要 rm /etc/localtime,否则时区修改可能无法生效(被替换回原值)。
RUN rm /etc/localtime &&\
echo "Asia/Shanghai" > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata

docker alpine 还要安装tzdata

apk add --no-cache tzdata

## 局部

echo 'export TZ=Asia/Shanghai' >> ~/.profile

docker 设置时区
golang:

# 注意,Debian Stretch 版本后需要 rm /etc/localtime,否则时区修改可能无法生效(被替换回原值)。
RUN rm /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
os.Setenv("TZ", "Africa/Cairo")

# Linux date命令
man date可以发现其参数众多。看起来有些乱,归纳一下:
Expand Down
3 changes: 2 additions & 1 deletion post/db/pg-display.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ private: true
---
# Pg display

\h help
\x vertical display
\h help
\c show connected to database and user

0 comments on commit 6d87d93

Please sign in to comment.