-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/docker-cli' into dev/v1.0.1
- Loading branch information
Showing
9 changed files
with
322 additions
and
35 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 |
---|---|---|
@@ -1 +1 @@ | ||
1.0.0 | ||
1.0.1 |
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,35 @@ | ||
FROM python:3.9-alpine3.15 AS python_modules | ||
# add openssh and clean | ||
RUN apk --no-cache --update add build-base jpeg-dev libffi-dev | ||
|
||
# install python modules | ||
ADD python/requirements.txt /generator.txt | ||
ADD python/hello_loopring/requirements.txt /hello_loopring.txt | ||
RUN pip install -r /generator.txt -r /hello_loopring.txt | ||
|
||
FROM node:16-alpine3.15 as node_modules | ||
# Set workdir initially just for npm to install | ||
WORKDIR /usr/src/app | ||
# Install modules | ||
ADD ipfs-hash/package*.json ./ | ||
RUN npm install --omit=dev | ||
RUN npm install --location=global pkg | ||
# Install app files, compile to native binary | ||
ADD ipfs-hash/* ./ | ||
RUN pkg ./cli.js -o ./ipfs-cid-linux | ||
|
||
FROM python:3.9-alpine3.15 | ||
# define workdir | ||
WORKDIR /loopygen | ||
# install python3.9 and ffmpeg | ||
RUN apk --no-cache --update add ffmpeg bash | ||
# get compiled modules from previous stages | ||
COPY --from=python_modules /usr/local/lib/python3.9 /usr/local/lib/python3.9 | ||
COPY --from=node_modules /usr/src/app/ipfs-cid-linux /usr/bin/cid | ||
# add scripts | ||
ADD dockerfiles/scripts/* /usr/local/bin/ | ||
# add app files | ||
ADD ./python ./python | ||
ADD ./.version ./.version | ||
RUN mkdir -p ./php && touch php/progress.json | ||
CMD ["bash"] |
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,56 @@ | ||
#!/usr/bin/env bash | ||
|
||
name="loopygen-cli" | ||
tag="sk33z3r/$name:1.0.1a" | ||
|
||
update() { | ||
cat <<EOF | ||
+-------------------------------------------------+ | ||
| | | ||
| ░▒█░░░░▄▀▀▄░▄▀▀▄░▒█▀▀█░█░░█░▒█▀▀█░█▀▀░█▀▀▄ | | ||
| ░▒█░░░░█░░█░█░░█░▒█▄▄█░█▄▄█░▒█░▄▄░█▀▀░█░▒█ | | ||
| ░▒█▄▄█░░▀▀░░░▀▀░░▒█░░░░▄▄▄▀░▒█▄▄▀░▀▀▀░▀░░▀ | | ||
| | | ||
| Created and Maintained By: | | ||
| sk33z3r.eth | | ||
| itsmonty.eth | | ||
| | | ||
+-------------------------------------------------+ | ||
EOF | ||
echo "Updating LooPyGen CLI..." | ||
docker pull $tag | ||
echo "...done!" | ||
} | ||
|
||
usage() { | ||
cat <<EOF | ||
LooPyGen CLI Utility Script | ||
Usage: $0 [command] | ||
Commands: | ||
update | Pull the latest image | ||
secrets | Force remove the secrets Docker volume | ||
{command} | Run a command inside the container | ||
EOF | ||
} | ||
|
||
case $1 in | ||
update) update;; | ||
secrets) docker volume rm -f $name;; | ||
-h|-help|help) usage;; | ||
cid) # only mount local directory and set a new workdir inside the container | ||
docker run -it --rm --name $name \ | ||
-w /scan \ | ||
-v $PWD:/scan \ | ||
$tag "$@" | ||
;; | ||
*) # run a command inside a self-destructing container | ||
docker run -it --rm --name $name \ | ||
-v $name:/loopygen/.secrets \ | ||
-v $PWD/collections:/loopygen/collections:rw \ | ||
$tag "$@" | ||
;; | ||
esac |
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
Oops, something went wrong.