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

Allow the users to run earthly without docker #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Skip this step if your base image is ubuntu or opensuse-leap. If you are buildin
| Parameter | Description | Type | Default Value |
|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------|
| CUSTOM_TAG | Environment name for provider image tagging. The default value is `demo`. | String | `demo` |
| EARTHLY_BIN | Path to earthly binary on the host system (e.g. /usr/local/bin/earthly). If empty the docker image of earthly is used. | String | |
| IMAGE_REGISTRY | Image registry name that will store the image artifacts. The default value points to the *ttl.sh* image registry, an anonymous and ephemeral Docker image registry where images live for a maximum of 24 hours by default. If you wish to make the images exist longer than 24 hours, you can use any other image registry to suit your needs. | String | `ttl.sh` |
| OS_DISTRIBUTION | OS distribution of your choice. For example, it can be `ubuntu` or `opensuse-leap`. | String | `ubuntu` |
| IMAGE_REPO | Image repository name in your chosen registry. | String | `$OS_DISTRIBUTION` |
Expand Down
7 changes: 6 additions & 1 deletion earthly.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -e

function build_with_proxy() {
export HTTP_PROXY=$HTTP_PROXY
export HTTPS_PROXY=$HTTPS_PROXY
Expand Down Expand Up @@ -37,7 +40,9 @@ if ! docker run --rm --privileged alpine sh -c 'echo "Privileged container test"
echo "Privileged containers are not allowed for the current user."
exit 1
fi
if [ -z "$HTTP_PROXY" ] && [ -z "$HTTPS_PROXY"]; then
if [ ! -z "${EARTHLY_BIN}" ]; then
"${EARTHLY_BIN}" --allow-privileged "$@"
elif [ -z "$HTTP_PROXY" ] && [ -z "$HTTPS_PROXY"]; then
build_without_proxy "$@"
else
build_with_proxy "$@"
Expand Down