用户工具

站点工具


linux:docker
  • yum
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum search docker
yum install docker-ce docker-ce-cli containerd.io  #--nobest
systemctl start docker
docker search mysql
docker pull centos-mysql-57-centos7
  • confluence
docker run --name confluence -p 8090:8090 -d cptactionhank/atlassian-confluence:6.3.4
  • 可选参数:数据目录映射,数据库连接
-v /root/docker/confluence:/var/atlassian/confluence
--link mysqlserver:db
  • 破解文件,必要时管理员登录:winpty docker exec -it -u root confluence bash
docker cp atlassian-extras-decoder-v2-3.2.jar confluence:/opt/atlassian/confluence/confluence/WEB-INF/lib
docker cp atlassian-universal-plugin-manager-plugin-2.22.jar confluence:/opt/atlassian/confluence/confluence/WEB-INF/atlassian-bundled-plugins
  • 重启并配置license
AAABMg0ODAoPeNptkE9rwkAQxe/7KRZ6aQ8rJmo0wkJrkrZCEqWm4qGX7TLqQrIJ+8fqt+/GVGqLh
4Vh37zfvJm7wgLO2An7Ie770+FkOvJwFBfY73sTFIPmSjRG1JJGtdyWFiQHfL8CdQD18DHFyYGVl
rUNKFJwLmJmgLZ20h8RP0TOaBg3OauA7r+Ogu2qx13FRNnjdYW4w/acLA5AjbLQfawMUwYU3bJSw
4WQZM50A/Gb4YqQCg5SQ3Fq4Dw5WmRZ8hbNn1JUdtIalG49PnJcaUAyt1tybIQ6Xa0QEH+CFmrHp
NDdjGzzomrboO4I85jOguGApHkxJrP165pswvAZrZKcukdSzxuPg0EYoJ9Arj+dx3+lc+DcVp+gF
tt37XJR4l0MtxMtreJ7puH/sb8B3NiXnTAsAhQL0FONTahP+LIrICxjzrPfM6s96QIUXUwi4rxX6
Au1nc1yI4ZaVM1uIPQ=X02fb
docker run --name confluence -p 8090:8090 -v /root/docker/confluence:/var/atlassian/confluence -d cptactionhank/atlassian-confluence:6.3.4
docker run -d --name jira -p 8070:8080 -v /root/docker/jira:/var/atlassian/jira cptactionhank/atlassian-jira:7.3.8
docker run --privileged=true -p 80:80 --name nginx -v /root/docker/nginx/www:/www -v /root/docker/nginx/conf:/etc/nginx -v /root/docker/nginx/logs:/wwwlogs -d nginx:1.12.0
docker run --name mysql -p 3306:3306 -v /root/docker/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=qweasdzxc123 -d mysql:5.7.16
docker run --name redis -p 6379:6379 -v /root/docker/redis/data:/data -d redis:3.2 redis-server --requirepass "123456" --appendonly yes
docker run -d -p 8081:8081 --name nexus -v /root/docker/nexus_data:/var/nexus-data --restart=always sonatype/nexus3:3.12.1
docker run --name gitlab-postgresql -e 'DB_NAME=gitlabhq_production'  -e 'DB_USER=gitlab' -e 'DB_PASS=password'  -e 'DB_EXTENSION=pg_trgm'  -v /root/docker/gitlab/postgresql:/var/lib/postgresql -d sameersbn/postgresql:9.6-2
docker run --name gitlab-redis -v /root/docker/gitlab/redis:/var/lib/redis -d sameersbn/redis:latest
docker run --name gitlab --link gitlab-postgresql:postgresql --link gitlab-redis:redisio     --publish 10022:22 --publish 10080:80     --env 'GITLAB_PORT=10080' --env 'GITLAB_SSH_PORT=10022'     --env 'GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alpha-numeric-string'     --env 'GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alpha-numeric-string'     --env 'GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alpha-numeric-string'     -e 'GITLAB_BACKUPS=daily'    -e 'GITLAB_HOST=192.168.10.189'    -e 'GITLAB_SIGNUP=true'     --volume /root/docker/gitlab/gitlab:/home/git/data  -d sameersbn/gitlab:11.0.1
  • registry
docker run -d -v /opt/docker/registry:/var/lib/registry -p 5000:5000 --restart=always -e "REGISTRY_STORAGE_DELETE_ENABLED=true" --name registry registry:latest
curl http://localhost:5000/v2/_catalog    //响应{"repositories":[]}
//使用127.0.0.1或者local时,没有进行安全检验。但使用外部ip地址推送时,Registry为了安全性考虑,默认需要https证书支持
{ "insecure-registries": ["实际的ip:端口"] }   //docker info
//推送镜像之前需要打标签 docker image tag hello-world:latest localhost:5000/hello-world:latest
docker push localhost:5000/hello-world:latest  //curl localhost:5000/v2/hello-world/tags/list
docker image rm hello-world
docker pull localhost:5000/hello-world   //docker images
docker run localhost:5000/hello-world
//获取镜像信息,启用删除功能:vi /etc/docker/registry/config.yml,storage.delete.enable=true
curl -X GET localhost:5000/v2/hello-world/manifests/latest  //docker push之后也会返回digest
curl -X DELETE localhost:5000/v2/hello-world/manifests/sha256:digest //删除tag,还需要后续清理空间
registry garbage-collect /etc/docker/registry/config.yml //进入镜像清理空间

镜像管理接口

方法 路径 分类 描述
GET /v2/ Base 检查是否支持2.0接口
GET /v2/${image}/tags/list Tags 获取镜像标签列表
GET /v2/${image}/manifests/ Manifest 获取镜像主要信息
PUT /v2/${image}/manifests/ Manifest 修改镜像主要信息
DELETE /v2/${image}/manifests/ Manifest 删除镜像的主要信息
GET /v2/${image}/blobs/ Blob 获得镜像层
DELETE /v2/${image}/blobs/ Blob 删除镜像层
POST /v2/${image}/blobs/uploads/ Initiate Blob Upload 开始分块上传
GET /v2/${image}/blobs/uploads/ Blob Upload 获得分块上传的速度
PATCH /v2/${image}/blobs/uploads/ Blob Upload 分块上传数据
PUT /v2/${image}/blobs/uploads/ Blob Upload 完成上传
DELETE /v2/${image}/blobs/uploads/ Blob Upload 取消上传
GET /v2/_catalog Catalog 获得镜像列表

linux/docker.txt · 最后更改: 2020/08/05 12:57 由 admin