-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace container management scripts with singular
adamant_env.sh
s…
…cript Fix to make `adamant_env.sh` executable Apply fix to README.md Rename compose.yaml->compose.yml
- Loading branch information
Showing
12 changed files
with
106 additions
and
69 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
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,84 @@ | ||
#!/bin/bash | ||
|
||
set +e | ||
|
||
if ! command -v docker &> /dev/null | ||
then | ||
if command -v podman &> /dev/null | ||
then | ||
function docker() { | ||
podman $@ | ||
} | ||
else | ||
echo "Neither docker nor podman found!!!" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
DOCKER_CONTAINER_NAME="adamant_container" | ||
DOCKER_IMAGE_NAME="ghcr.io/lasp/adamant:latest" | ||
DOCKER_COMPOSE_COMMAND="docker compose" | ||
export DOCKER_CONTAINER_NAME | ||
export DOCKER_IMAGE_NAME | ||
export DOCKER_COMPOSE_COMMAND | ||
${DOCKER_COMPOSE_COMMAND} version &> /dev/null | ||
if [ "$?" -ne 0 ]; then | ||
export DOCKER_COMPOSE_COMMAND="docker-compose" | ||
fi | ||
|
||
# Helper function to print out command as executed: | ||
execute () { | ||
echo "$ $@" | ||
eval "$@" | ||
} | ||
|
||
set -e | ||
|
||
usage() { | ||
echo "Usage: $1 [start, stop, login, push, build, remove]" >&2 | ||
echo "* start: create and start the adamant container" >&2 | ||
echo "* stop: stop the running adamant container" >&2 | ||
echo "* login: login to the adamant container" >&2 | ||
echo "* push: push the image to the Docker registry" >&2 | ||
echo "* build: build the image from the Dockerfile" >&2 | ||
echo "* remove: remove network and volumes for adamant" >&2 | ||
exit 1 | ||
} | ||
|
||
if [ "$#" -eq 0 ]; then | ||
usage $0 | ||
fi | ||
|
||
case $1 in | ||
start ) | ||
execute "${DOCKER_COMPOSE_COMMAND} -f compose.yml up -d" | ||
echo "" | ||
echo "Run \"./adamant_env.sh login\" to log in." | ||
;; | ||
stop ) | ||
execute "${DOCKER_COMPOSE_COMMAND} -f compose.yml stop" | ||
;; | ||
login ) | ||
execute "docker exec -it -u user ${DOCKER_CONTAINER_NAME} //bin//bash" | ||
;; | ||
push ) | ||
execute "docker push ${DOCKER_IMAGE_NAME}" | ||
;; | ||
build ) | ||
execute "docker build --progress=plain -t ${DOCKER_IMAGE_NAME} -f Dockerfile ." | ||
;; | ||
remove ) | ||
if [ "$2" == "force" ] | ||
then | ||
execute "${DOCKER_COMPOSE_COMMAND} -f compose.yml down -t 30 -v" | ||
else | ||
echo "Are you sure? This removes ALL docker volumes and all Adamant data! (1-Yes / 2-No)" | ||
select yn in "Yes" "No"; do | ||
case $yn in | ||
Yes ) execute "${DOCKER_COMPOSE_COMMAND} -f compose.yml down -t 30 -v"; break;; | ||
No ) exit;; | ||
esac | ||
done | ||
fi | ||
;; | ||
esac |
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
name: adamant | ||
services: | ||
adamant: | ||
container_name: adamant_container | ||
volumes: | ||
- type: bind | ||
source: ../../adamant | ||
target: /home/user/adamant | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
network_mode: host | ||
image: ghcr.io/lasp/adamant:latest | ||
command: sleep infinity |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.