Merge pull request #3589 from yixingjia/noroot_notary

Run notary related images with user notary
This commit is contained in:
Daniel Jiang 2017-11-12 22:56:59 -06:00 committed by GitHub
commit 01493508c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 9 deletions

View File

@ -16,8 +16,6 @@ services:
- harbor-notary - harbor-notary
volumes: volumes:
- ./common/config/notary:/config - ./common/config/notary:/config
entrypoint: /usr/bin/env sh
command: -c "/migrations/migrate.sh && notary-server -config=/config/server-config.json -logf=logfmt"
depends_on: depends_on:
- notary-db - notary-db
- notary-signer - notary-signer
@ -39,8 +37,6 @@ services:
- ./common/config/notary:/config - ./common/config/notary:/config
env_file: env_file:
- ./common/config/notary/signer_env - ./common/config/notary/signer_env
entrypoint: /usr/bin/env sh
command: -c "/migrations/migrate.sh && notary-signer -config=/config/signer-config.json -logf=logfmt"
depends_on: depends_on:
- notary-db - notary-db
logging: logging:

View File

@ -0,0 +1,3 @@
#!/bin/sh
chown 10000:10000 -R /config
sudo -E -u \#10000 sh -c "/usr/bin/env /migrations/migrate.sh && /bin/notary-server -config=/config/server-config.json -logf=logfmt"

View File

@ -2,10 +2,15 @@ FROM vmware/photon:1.0
RUN tdnf distro-sync -y \ RUN tdnf distro-sync -y \
&& tdnf erase vim -y \ && tdnf erase vim -y \
&& tdnf clean all && tdnf install -y shadow sudo \
&& tdnf clean all \
&& groupadd -r -g 10000 notary \
&& useradd --no-log-init -r -g 10000 -u 10000 notary
COPY ./binary/notary-server /bin/notary-server COPY ./binary/notary-server /bin/notary-server
COPY ./migrate /bin/migrate COPY ./migrate /bin/migrate
COPY ./migrations/ /migrations/ COPY ./migrations/ /migrations/
COPY ./server-start.sh /bin/server-start.sh
RUN chmod u+x /bin/notary-server /migrations/migrate.sh /bin/migrate /bin/server-start.sh
ENV SERVICE_NAME=notary_server ENV SERVICE_NAME=notary_server
ENTRYPOINT [ "notary-server" ] ENTRYPOINT [ "/bin/server-start.sh" ]

View File

@ -0,0 +1,3 @@
#!/bin/sh
chown 10000:10000 -R /config
sudo -E -u \#10000 sh -c "/usr/bin/env && /migrations/migrate.sh && /bin/notary-signer -config=/config/signer-config.json -logf=logfmt"

View File

@ -2,10 +2,15 @@ FROM vmware/photon:1.0
RUN tdnf distro-sync -y \ RUN tdnf distro-sync -y \
&& tdnf erase vim -y \ && tdnf erase vim -y \
&& tdnf clean all && tdnf install -y shadow sudo \
&& tdnf clean all \
&& groupadd -r -g 10000 notary \
&& useradd --no-log-init -r -g 10000 -u 10000 notary
COPY ./binary/notary-signer /bin/notary-signer COPY ./binary/notary-signer /bin/notary-signer
COPY ./migrate /bin/migrate COPY ./migrate /bin/migrate
COPY ./migrations/ /migrations/ COPY ./migrations/ /migrations/
COPY ./signer-start.sh /bin/signer-start.sh
RUN chmod u+x /bin/notary-signer /migrations/migrate.sh /bin/migrate /bin/signer-start.sh
ENV SERVICE_NAME=notary_signer ENV SERVICE_NAME=notary_signer
ENTRYPOINT [ "notary-signer" ] ENTRYPOINT [ "/bin/signer-start.sh" ]