-
Notifications
You must be signed in to change notification settings - Fork 11
Adding support for production grade image in Dockerfile #180
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
Merged
cendhu
merged 18 commits into
hyperledger:main
from
anushka159-a:feature/production_docker_image
Jan 13, 2026
Merged
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
75711ab
Adding support for production grade image in Dockerfile
anushka159-a 47374d5
Modifying the binary path in Dockerfile
anushka159-a 6629ad1
Reverting to ubi-micro 9.4
anushka159-a 4c4fd12
Modified the entrypoint
anushka159-a 8731dcf
Modified the entrypoint
anushka159-a eba5d35
Merge remote-tracking branch 'origin/main' into feature/production_do…
pasquale95 507b9e3
improved Dockerfile and scripts to build image
pasquale95 749fae4
use `:latest` as tag in docker test
pasquale95 b3b1c68
fixed name for committer and loadgen images
pasquale95 5fd0841
remove `ZRL`
pasquale95 f1e704e
removed bin as first param since specified as entrypoint
pasquale95 9e15c6f
run container as host user
pasquale95 a479564
adding logs for debugging
pasquale95 49586b7
run containers with root user to access config under `/root/config`
pasquale95 eb8c4fd
removed debug logs
pasquale95 2daf3d6
Merge branch 'main' into feature/production_docker_image
pasquale95 b2442f7
Merge branch 'main' into feature/production_docker_image
pasquale95 370b548
use same labels as Hyperledger-Fabric
pasquale95 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 hidden or 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 hidden or 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 hidden or 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,13 +1,48 @@ | ||
| # | ||
| # Copyright IBM Corp. All Rights Reserved. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| FROM registry.access.redhat.com/ubi9/ubi-micro:9.4 AS prod | ||
|
|
||
| ########################################### | ||
| # Stage 1: Production runtime image | ||
| ########################################### | ||
| FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6 AS prod | ||
|
|
||
| ARG BIN | ||
| ARG ARCHBIN_PATH | ||
| ARG PORTS | ||
| ARG TARGETOS | ||
| ARG TARGETARCH | ||
| ARG PORTS | ||
| ARG VERSION=1.0 | ||
|
|
||
| # Add non-root user (10001) using BIN argument | ||
| RUN /usr/sbin/useradd -u 10001 -r -g root -s /sbin/nologin -c "Hyperledger Fabric-X ${BIN} user" ${BIN} && \ | ||
| mkdir -p /home/${BIN} && \ | ||
| chown -R 10001:0 /home/${BIN} && \ | ||
| chmod 0755 /home/${BIN} | ||
|
|
||
| # Copy binaries | ||
| COPY ${ARCHBIN_PATH}/${TARGETOS}-${TARGETARCH}/${BIN} /bin/${BIN} | ||
|
|
||
| # Create fixed entrypoint since args are not replaced | ||
| # within ENTRYPOINT or CMD | ||
| RUN ln -s /bin/${BIN} /bin/entrypoint | ||
|
|
||
| # Expose ports | ||
| EXPOSE ${PORTS} | ||
|
|
||
| # OCI metadata labels | ||
| LABEL name="${BIN}" \ | ||
| maintainer="IBM Research ZRL Decentralized Trust Group" \ | ||
| version="${VERSION}" \ | ||
| description="Hyperledger Fabric-X ${BIN} packaged in a UBI image" \ | ||
| license="Apache-2.0" \ | ||
| vendor="IBM" | ||
|
|
||
| # Use non-root user and set workdir using BIN argument | ||
| USER 10001 | ||
| WORKDIR /home/${BIN} | ||
|
|
||
| # Default Entrypoint | ||
| ENTRYPOINT ["/bin/entrypoint"] | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.