Skip to content
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

Embed serve as default command to run the server container #947

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 19 additions & 24 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ COPY --from=xrootd-plugin-builder /usr/include/nlohmann /usr/include/nlohmann
# Copy the JSON schema validator library
COPY --from=xrootd-plugin-builder /usr/lib64/libnlohmann_json_schema_validator.a /usr/lib64/

# Eventually add more entrypoint commands here
COPY images/entrypoint.sh /entrypoint.sh

# Copy here to reduce dependency on the pelican-build stage in the final-stage and x-base stage
Expand All @@ -206,17 +205,13 @@ RUN chmod +x /pelican/pelican \
######################
FROM final-stage AS pelican-base

WORKDIR /pelican

RUN rm -rf /pelican/osdf

######################
# OSDF base stage #
######################
FROM final-stage AS osdf-base

WORKDIR /pelican

RUN rm -rf /pelican/pelican

####################
Expand All @@ -225,66 +220,66 @@ RUN rm -rf /pelican/pelican

FROM pelican-base AS cache

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "pelican", "cache"]
ENTRYPOINT [ "/entrypoint.sh", "pelican", "cache"]
CMD [ "serve" ]

####################
# pelican/origin #
# pelican/origin #
####################

FROM pelican-base AS origin

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "pelican", "origin"]
ENTRYPOINT [ "/entrypoint.sh" ,"pelican", "origin"]
CMD [ "serve" ]

####################
# pelican/director #
####################

FROM pelican-base AS director

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "pelican", "director"]
ENTRYPOINT [ "/entrypoint.sh" ,"pelican", "director"]
CMD [ "serve" ]

####################
# pelican/registry #
####################

FROM pelican-base AS registry

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "pelican", "registry"]
ENTRYPOINT [ "/entrypoint.sh" ,"pelican", "registry"]
CMD [ "serve" ]

####################################
# OSDF #
####################################

####################
# osdf/cache #
# osdf/cache #
####################

FROM osdf-base AS osdf-cache

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "osdf", "cache"]
ENTRYPOINT [ "/entrypoint.sh" ,"osdf", "cache"]
CMD [ "serve" ]

####################
# osdf/origin #
# osdf/origin #
####################

FROM osdf-base AS osdf-origin

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "osdf", "origin"]
ENTRYPOINT [ "/entrypoint.sh" ,"osdf", "origin"]
CMD [ "serve" ]

####################
# osdf/director #
####################

FROM osdf-base AS osdf-director

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "osdf", "director"]
ENTRYPOINT [ "/entrypoint.sh" ,"osdf", "director"]
CMD [ "serve" ]


####################
Expand All @@ -293,5 +288,5 @@ ENTRYPOINT ["/entrypoint.sh", "osdf", "director"]

FROM osdf-base AS osdf-registry

WORKDIR /pelican
ENTRYPOINT ["/entrypoint.sh", "osdf", "registry"]
ENTRYPOINT [ "/entrypoint.sh" ,"osdf", "registry"]
CMD [ "serve" ]
4 changes: 2 additions & 2 deletions images/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ if [ $# -ne 0 ]; then
;;
esac
else
echo "usage: [command] [args...]"
echo "example: docker run pelican_platform/cache serve -p 8443"
echo "Usage: [args...]"
echo "example: docker run pelican_platform/cache -p 8443"
fi
Loading