-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker: data dir & user permissions, install ca-certificates, better data dir location, more. #58
Merged
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4228843
Add entrypoint and handling for mounted data directory.
winder 399c720
Add ca-certificate so service providers work.
winder ee877a0
Use gosu and get arguments working.
winder f47da84
Enable docker build.
winder e3b5397
Switch user to algorand, minor fixes
winder d9aefe3
Fix CMD.
winder c5e4559
Add some clarifying comments.
winder 32e227e
Update docker/docker-entrypoint.sh
winder db30190
Update docs/Docker.md
winder 570257a
Wording
winder f97c8db
Wording
winder 5cd9e95
Wording
winder bc0d73b
Update docs/Docker.md
winder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
# This dockerfile is used by goreleaser | ||
FROM debian:bullseye-slim | ||
|
||
RUN useradd conduit | ||
RUN mkdir -p /conduit/data && \ | ||
chown -R conduit.conduit /conduit | ||
RUN groupadd --gid=999 --system algorand && \ | ||
algochoi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
useradd --uid=999 --no-log-init --create-home --system --gid algorand algorand && \ | ||
mkdir -p /data && \ | ||
chown -R algorand.algorand /data && \ | ||
apt-get update && \ | ||
apt-get install -y gosu ca-certificates && \ | ||
update-ca-certificates && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# binary is passed into the build | ||
COPY conduit /conduit/conduit | ||
COPY conduit /usr/local/bin/conduit | ||
COPY docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
|
||
USER conduit | ||
WORKDIR /conduit | ||
ENTRYPOINT ["./conduit"] | ||
CMD ["-d", "data"] | ||
ENV CONDUIT_DATA_DIR /data | ||
WORKDIR /data | ||
ENTRYPOINT ["docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# To allow mounting the data directory we need to change permissions | ||
# to our algorand user. The script is initially run as the root user | ||
# in order to change permissions, afterwards the script is re-launched | ||
winder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# as the algorand user. | ||
if [ "$(id -u)" = '0' ]; then | ||
chown -R algorand:algorand $CONDUIT_DATA_DIR | ||
exec gosu algorand "$0" "$@" | ||
fi | ||
|
||
# always run the conduit command | ||
exec conduit "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this deploy to docker hub every time a release tag is created? I'm not familiar with the frequency that this workflow is triggered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's been triggered once so far.