Skip to content

Commit

Permalink
fix: security-secretstore-setup volume init semantics (#4092)
Browse files Browse the repository at this point in the history
* fix: security-secretstore-setup volume init semantics

fixes: #3852
Signed-off-by: Valina Li <valina.li@intel.com>
  • Loading branch information
vli11 committed Jul 14, 2022
1 parent 5ac2a4f commit 66f7195
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 3 additions & 5 deletions cmd/security-secretstore-setup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------------------------
# Copyright 2019 Dell Technologies, Inc.
# Copyright 2020 Intel Corp.
# Copyright 2022 Intel Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,11 +49,9 @@ COPY --from=builder /edgex-go/cmd/security-secretstore-setup/res/kong-admin-conf
COPY --from=builder /edgex-go/cmd/security-file-token-provider/security-file-token-provider .
COPY --from=builder /edgex-go/cmd/security-secretstore-setup/security-secretstore-setup .

# Setup the entry point script, create token dir, and assign perms
# Setup the entry point script
COPY --from=builder /edgex-go/cmd/security-secretstore-setup/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh \
&& ln -s /usr/local/bin/entrypoint.sh / \
&& mkdir -p /vault/config/assets \
&& chown -Rh 100:1000 /vault/
&& ln -s /usr/local/bin/entrypoint.sh /

ENTRYPOINT ["entrypoint.sh"]
6 changes: 5 additions & 1 deletion cmd/security-secretstore-setup/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/dumb-init /bin/sh
# ----------------------------------------------------------------------------------
# Copyright (c) 2020 Intel Corporation
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,10 @@ set -e

# env settings are populated from env files of docker-compose

# create token dir, and assign perms
mkdir -p /vault/config/assets
chown -Rh 100:1000 /vault/

echo "Initializing secret store..."
/security-secretstore-setup --vaultInterval=10

Expand Down

0 comments on commit 66f7195

Please sign in to comment.