Docker PgAdmin4
start pgadmin4 5.1 in docker docker-compose.yml version: '3.1' services: pgadmin4: image: dpage/pgadmin4:5.1 ports: - 8081:80 restart: always environment: PGADMIN_DEFAULT_EMAIL: {email} PGADMIN_DEFAULT_PASSWORD: {password}
start pgadmin4 5.1 in docker docker-compose.yml version: '3.1' services: pgadmin4: image: dpage/pgadmin4:5.1 ports: - 8081:80 restart: always environment: PGADMIN_DEFAULT_EMAIL: {email} PGADMIN_DEFAULT_PASSWORD: {password}
start postgresql 13 and pgadmin4 5.1 in docker,use ~/postgresql/data to persist data docker-compose.yml version: '3.1' services: postgresql: image: postgres:13 volumes: - ~/postgresql/data:/var/lib/postgresql/data ports: - 5432:5432 restart: always environment: POSTGRES_PASSWORD: {password} pgadmin4: image: dpage/pgadmin4:5.1 ports: - 80:80 restart: always environment: PGADMIN_DEFAULT_EMAIL: {email} PGADMIN_DEFAULT_PASSWORD: {password}
start rabbitmq 3.8.14 and management plugin in docker docker-compose.yml version: '3.1' services: rabbitmq: image: rabbitmq:3.8.14-management ports: - 15672:15672 - 5672:5672 restart: always environment: RABBITMQ_DEFAULT_USER: {username} RABBITMQ_DEFAULT_PASS: {password}
start redis 6.2 in docker,use ~/redis/data to persist data docker-compose.yml version: '3.1' services: redis: image: redis:latest container_name: redis command: redis-server --requirepass {password} --appendonly yes #command: redis-server /usr/local/etc/redis/redis.conf volumes: - ~/redis/redis.conf:/usr/local/etc/redis/redis.conf - redis-data:/data ports: - 6379:6379 restart: always network_mode: bridge volumes: redis-data: external: true redis.conf requirepass {password} appendonly yes daemonize no
generate ssh-keygen -t ed25519 -C "comment" ssh-copy-id 把本机公钥复制到远程服务器,实现 SSH 免密登录。 ssh-copy-id user@host 如果 SSH 端口不是默认的 22: ssh-copy-id -p 2222 user@host 如果要指定公钥文件: ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host 复制完成后测试登录: ssh user@host 如果远程 SSH 使用非默认端口: ssh -p 2222 user@host 常见问题 确认远程服务器开启公钥认证: sudo vim /etc/ssh/sshd_config PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys 修改后重启 SSH 服务: sudo systemctl restart sshd
Install # use aliyun mirror curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun mirrors { "registry-mirrors": [ "https://dockerproxy.com", "https://registry.docker-cn.com" ] } # registry sudo docker run -d -p 5000:5000 --restart always --name registry -v docker-registry:/var/lib/registry registry:2 # nexus oss3 sudo docker volume create nexus-data sudo docker run -d --restart always -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3 issue 在docker容器内部执行 jmap命令报错 Operation not permitted # Docker 自1.10版本开始加入的安全特性。类似于 jmap 这些 JDK 工具依赖于 Linux 的 PTRACE_ATTACH,而是Docker自1.10在默认的seccomp配置文件中禁用了ptrace # 如果使用docker-compose启动容器,如下加入 cap_add即可 # example version: '2' services: content1: image: xxx/content container_name: content restart: always cap_add: - SYS_PTRACE expose: - 80 ports: - "8080:80" volumes: ...... # 使用原生docker run命令增加–cap-add=SYS_PTRACE docker run –cap-add=SYS_PTRACE ........ container access to host use host.docker.internal as localhost
Install Hugo # macos brew install hugo # windows using scoop scoop install hugo New Post hugo new content/posts/name.md Hugo will use archetypes/default.md to generate the front matter. If the post name contains spaces, escape the spaces or use a file name without spaces. Update Theme If the theme is managed by git submodule: git submodule update --init --recursive Deploy to Middleware hugo --minify Then, upload files in the public folder to middleware folder(eg. html folder in nginx) ...