forked from enola-dev/enola
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (cli): Introduce Enola container image for end-users (re. enola-…
…dev#181 and enola-dev#180)
- Loading branch information
Showing
6 changed files
with
92 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM gcr.io/distroless/java21-debian12:nonroot | ||
|
||
# Loosely inspired by https://github.com/GoogleContainerTools/distroless/blob/main/examples/java/Dockerfile | ||
|
||
# For consistency, use Enola's standard "distro" | ||
# (instead of e.g. directly COPY bazel-bin/cli/enola_deploy.jar)... | ||
|
||
# ...BUT note that we still CANNOT just do e.g. ENTRYPOINT ["enola"], | ||
# because in a (non :debug!) distroless we (intentionally!) do not | ||
# even have any shell - so we still just have to "java -jar enola". | ||
|
||
# Nota bene: The /app/CWD/ and ../enola circus is to be able to use | ||
# 'docker run ... -v "$PWD":/app/CWD/:Z' in the 'enola-c' launch script; | ||
# see docs/use/index.md. | ||
|
||
WORKDIR /app/CWD/ | ||
COPY --chmod=0777 --chown=nonroot:nonroot site/download/latest/enola /app/enola | ||
ENTRYPOINT [ "java", "-jar", "../enola" ] | ||
|
||
# To debug, replace FROM :nonroot with :debug-nonroot, | ||
# and use ENTRYPOINT [ "/busybox/sh" ] instead of above, | ||
# and then "docker run" WITHOUT any additional arguments. |
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,22 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright 2023 The Enola <https://enola.dev> Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -euo pipefail | ||
: "${ENOLA_IMAGE:=ghcr.io/enola-dev/enola:latest}" | ||
|
||
set -x | ||
docker run --rm -v "$PWD":/app/CWD/:Z -it "$ENOLA_IMAGE" "$@" |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright 2023 The Enola <https://enola.dev> Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# TODO Transform this into a Bazel target instead... | ||
set -euox pipefail | ||
|
||
tools/distro/build.bash | ||
|
||
# TODO Test output | ||
site/download/latest/enola help | ||
site/download/latest/enola --version | ||
site/download/latest/enola get --model file:docs/use/library/model.yaml demo.book_kind/0-13-140731-7 | ||
|
||
# TODO Test output | ||
ENOLA_IMAGE=localhost/enola:latest docs/download/latest/enolac help | ||
ENOLA_IMAGE=localhost/enola:latest docs/download/latest/enolac --version | ||
ENOLA_IMAGE=localhost/enola:latest docs/download/latest/enolac \ | ||
get --model file:docs/use/library/model.yaml demo.book_kind/0-13-140731-7 |