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

Slim down hoisted docker container a touch #1

Open
wants to merge 2 commits into
base: master
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
29 changes: 26 additions & 3 deletions hoisted/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM java:8
FROM openjdk:8 AS base

RUN apt update && apt upgrade -y && \
apt install -y apt-transport-https
Expand All @@ -10,11 +10,34 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B
RUN apt update && \
apt install -y git sbt

RUN cd ~ && git clone https://github.com/hoisted/hoisted.git && \
cd hoisted && git checkout tags/v0.4.2 && sbt assembly && \
RUN mkdir hoisted

COPY hoisted/build.sbt hoisted/

RUN mkdir hoisted/project

COPY hoisted/project hoisted/project

WORKDIR hoisted

RUN sbt assembly

WORKDIR /

COPY hoisted hoisted

WORKDIR hoisted

RUN sbt assembly && \
cp target/scala-2.12/hoisted.jar /usr/local/lib/hoisted.jar &&\
cd ~ && rm -rf hoisted .ivy2 .sbt

COPY ./entrypoint.sh /usr/bin/entrypoint.sh

FROM openjdk:alpine

COPY --from=base /usr/local/lib/hoisted.jar /usr/local/lib/hoisted.jar
COPY --from=base /usr/bin/entrypoint.sh /usr/bin/entrypoint.sh

RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
6 changes: 5 additions & 1 deletion hoisted/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd ${DIR}

docker build -t opentelegram/hoisted:latest -f Dockerfile .
git clone https://github.com/hoisted/hoisted.git

docker build -t shadowfiend/hoisted:latest -f Dockerfile .

rm -rf hoisted/