Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
[root@k8s-worker01 ~]# docker run -d -p 5000:5000 --restart always --name registry registry:2
Unable to find image 'registry:2' locally
Trying to pull repository docker.io/library/registry ... 
2: Pulling from docker.io/library/registry
c87736221ed0: Pull complete 
1cc8e0bb44df: Pull complete 
54d33bcb37f5: Pull complete 
e8afc091c171: Pull complete 
b4541f6d3db6: Pull complete 
Digest: sha256:3b00e5438ebd8835bcfa7bf5246445a6b57b9a50473e89c02ecc8e575be3ebb5
Status: Downloaded newer image for docker.io/registry:2
cfbef4ebde24a03fbcc544b93e2f182258bbda004c268458ee6efb6267d75739
[root@k8s-worker01 ~]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
cfbef4ebde24        registry:2          "/entrypoint.sh /e..."   13 seconds ago      Up 11 seconds       0.0.0.0:5000->5000/tcp   registry


Code Block
[root@k8s-worker01 ~]# mkdir certs
[root@k8s-worker01 ~]# 
[root@k8s-worker01 ~]# openssl req \
>   -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key \
>   -x509 -days 365 -out certs/domain.crt
Generating a 4096 bit RSA private key
...................................................++
........................................................................++
writing new private key to 'certs/domain.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:kr
State or Province Name (full name) []:seoul      
Locality Name (eg, city) [Default City]:seoul 
Organization Name (eg, company) [Default Company Ltd]:sptek
Organizational Unit Name (eg, section) []:engops
Common Name (eg, your name or your server's hostname) []:registry.thesanse.com
Email Address []:sooabia22@sptek.co.kr
[root@k8s-worker01 ~]# cd certs
[root@k8s-worker01 certs]# ls
domain.crt  domain.key
[root@k8s-worker01 certs]# ls
domain.crt  domain.key
[root@k8s-worker01 certs]#