|
| 1 | +## 1. Build container image |
| 2 | +``` |
| 3 | +docker build -t pccs:my_tag . |
| 4 | +``` |
| 5 | + |
| 6 | +## 2. Generate certificates to use with PCCS |
| 7 | +``` |
| 8 | +mkdir -p ~/pccs_tls |
| 9 | +cd ~/pccs_tls |
| 10 | +openssl genrsa -out private.pem 2048 |
| 11 | +openssl req -new -key private.pem -out csr.pem |
| 12 | +openssl x509 -req -days 365 -in csr.pem -signkey private.pem -out file.crt |
| 13 | +rm -rf csr.pem |
| 14 | +``` |
| 15 | +and give read access to the certificate/key in order they're to be readable inside container by user other than host files owner: |
| 16 | +``` |
| 17 | +chmod 644 ~/pccs_tls/* |
| 18 | +``` |
| 19 | + |
| 20 | +## 3. Fill up configuration file |
| 21 | +Create directory for storing configuration file: |
| 22 | +``` |
| 23 | +mkdir -p ~/config |
| 24 | +``` |
| 25 | +Copy `<path_to_repo>/SGXDataCenterAttestationPrimitives/QuoteGeneration/pccs/config/default.json` |
| 26 | +to this directory: |
| 27 | +``` |
| 28 | +cp <path_to_repo>/SGXDataCenterAttestationPrimitives/QuoteGeneration/pccs/config/default.json ~/config/ |
| 29 | +``` |
| 30 | +Generate UserTokenHash: |
| 31 | +``` |
| 32 | +echo -n "user_password" | sha512sum | tr -d '[:space:]-' |
| 33 | +``` |
| 34 | +and AdminTokenHash: |
| 35 | +``` |
| 36 | +echo -n "admin_password" | sha512sum | tr -d '[:space:]-' |
| 37 | +``` |
| 38 | +and paste generated values into the `~/config/default.json` |
| 39 | + |
| 40 | +Fill other required fields accordingly. |
| 41 | + |
| 42 | +## 4. Run container |
| 43 | +``` |
| 44 | +cd && \ |
| 45 | +docker run \ |
| 46 | +--user "65333:0" \ |
| 47 | +-v $PWD/pccs_tls/private.pem:/opt/intel/pccs/ssl_key/private.pem \ |
| 48 | +-v $PWD/pccs_tls/file.crt:/opt/intel/pccs/ssl_key/file.crt \ |
| 49 | +-v $PWD/config/default.json:/opt/intel/pccs/config/default.json \ |
| 50 | +-p 8081:8081 --name pccs -d pccs:my_tag |
| 51 | +``` |
| 52 | + |
| 53 | +## 5 . Check if pccs service is running and available: |
| 54 | +``` |
| 55 | +docker logs -f pccs |
| 56 | +``` |
| 57 | + |
| 58 | +Output: |
| 59 | + |
| 60 | +``` |
| 61 | +2021-08-01 20:54:24.700 [info]: DB Migration -- Update pcs_version table |
| 62 | +2021-08-01 20:54:24.706 [info]: DB Migration -- update pck_crl.pck_crl from HEX string to BINARY |
| 63 | +2021-08-01 20:54:24.709 [info]: DB Migration -- update pcs_certificates.crl from HEX string to BINARY |
| 64 | +2021-08-01 20:54:24.711 [info]: DB Migration -- update platforms(platform_manifest,enc_ppid) from HEX string to BINARY |
| 65 | +2021-08-01 20:54:24.713 [info]: DB Migration -- update platforms_registered(platform_manifest,enc_ppid) from HEX string to BINARY |
| 66 | +2021-08-01 20:54:24.715 [info]: DB Migration -- Done. |
| 67 | +2021-08-01 20:54:24.831 [info]: HTTPS Server is running on: https://localhost:8081 |
| 68 | +
|
| 69 | +``` |
| 70 | + |
| 71 | +Execute command: |
| 72 | +``` |
| 73 | +curl -kv https://localhost:8081 |
| 74 | +``` |
| 75 | +to check if pccs service is available. |
| 76 | + |
| 77 | +## 6. Stop container: |
| 78 | +``` |
| 79 | +docker stop pccs |
| 80 | +``` |
| 81 | + |
0 commit comments