docker 개인 창고 구축(사용자 인증, 웹 관리)

2758 단어
ubuntu:16.04
docker:18.06.0-ce
docker 창고 서버: 192.168.83.102
분할선 --------------------------------------------------------------------------------------------------------
1. 개인 키 및 인증서 mkdir conf 생성
openssl req -new -newkey rsa:4096 -days 365 -subj "/CN=localhost" \
        -nodes -x509 -keyout conf/auth.key -out conf/auth.cert

2. 등록표 설정vimconf/registry-srv를 만듭니다.ym
version: 0.1    

storage:
  filesystem:
    rootdirectory: /var/lib/registry
  delete:
enabled: true http: addr:
0.0.0.0:5000 auth: token: # external url to docker-web authentication endpoint realm: http://192.168.83.102:8080/api/auth # should be same as registry.name of registry-web service: 192.168.83.102:5000 # should be same as registry.auth.issuer of registry-web issuer: 'my issuer' # path to auth certificate rootcertbundle: /etc/docker/registry/auth.cert

 
3. 용기 서비스 시작registry-srv
docker run \
    -v /data/registry:/var/lib/registry \
    -v $(pwd)/conf/registry-srv.yml:/etc/docker/registry/config.yml:ro \
    -v $(pwd)/conf/auth.cert:/etc/docker/registry/auth.cert:ro \
    -p 5000:5000  --name=registry-srv --restart=always -d registry:2

4. 프로필vimconf/registry-web를 만듭니다.yml
registry:
  # Docker registry url
  url: http://192.168.83.102:5000/v2
  # Docker registry fqdn
  name: 192.168.83.102:5000
  # To allow image delete, should be false
  readonly: false
  auth:
    # Enable authentication
    enabled: true
    # Token issuer
    # should equals to auth.token.issuer of docker registry
    issuer: 'my issuer'
    # Private key for token signing
    # certificate used on auth.token.rootcertbundle should signed by this key
    key: /conf/auth.key

5. 용기 서비스 시작registry-web
docker run -v $(pwd)/conf/registry-web.yml:/conf/config.yml:ro \
           -v $(pwd)/conf/auth.key:/conf/auth.key -v $(pwd)/db:/data \
           -d -p 8080:8080 --restart=always --link registry-srv --name=registry-web hyper/docker-registry-web

6. 웹을 통해 서버 주소에 접근http://192.168.83.102:8080
기본 사용자 암호는admin/admin
다음으로 전송:https://www.cnblogs.com/zcm1993/p/9732648.html

좋은 웹페이지 즐겨찾기