Skip to content
Snippets Groups Projects
Unverified Commit c61172cd authored by Luis Paolini's avatar Luis Paolini Committed by GitHub
Browse files

Trim packages and update (#14585)

* Trim packages and update

- Removed the make and wget dependency
- Made the release container to auto-update
- Adds are now a curl in a single command to reduce intermediate images
- consecutive run commands into 1 line
- ENVs to 1 line to reduce intermediate images

* Update the docker file for the releases
parent 55ecc874
No related branches found
No related tags found
No related merge requests found
......@@ -7,29 +7,26 @@ FROM adoptopenjdk/openjdk8:alpine as builder
WORKDIR /app/source
ENV FC_LANG en-US
ENV LC_CTYPE en_US.UTF-8
ENV FC_LANG en-US LC_CTYPE en_US.UTF-8
# bash: various shell scripts
# wget: installing lein (TODO -- is this actually needed? We don't use wget directly)
# curl: needed by script that installs Clojure CLI
# git: ./bin/version
# yarn: frontend building
# make: backend building (TODO -- huh? We don't use Make to build the backend)
# gettext: translations
# java-cacerts: installs updated cacerts to /etc/ssl/certs/java/cacerts
RUN apk add --no-cache coreutils bash yarn git wget curl make gettext java-cacerts
RUN apk add --no-cache coreutils bash yarn git curl gettext java-cacerts
# lein: backend dependencies and building
ADD https://raw.github.com/technomancy/leiningen/stable/bin/lein /usr/local/bin/lein
RUN chmod 744 /usr/local/bin/lein
RUN lein upgrade
RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -o /usr/local/bin/lein && \
chmod +x /usr/local/bin/lein && \
/usr/local/bin/lein upgrade
# Clojure CLI (needed for some build scripts)
ADD https://download.clojure.org/install/linux-install-1.10.1.708.sh /tmp/linux-install-1.10.1.708.sh
RUN chmod +x /tmp/linux-install-1.10.1.708.sh
RUN /tmp/linux-install-1.10.1.708.sh
RUN curl https://download.clojure.org/install/linux-install-1.10.1.708.sh -o /tmp/linux-install-1.10.1.708.sh && \
chmod +x /tmp/linux-install-1.10.1.708.sh && \
sh /tmp/linux-install-1.10.1.708.sh
# install dependencies before adding the rest of the source to maximize caching
......@@ -48,8 +45,8 @@ COPY . .
RUN INTERACTIVE=false bin/build
# import AWS RDS cert into /etc/ssl/certs/java/cacerts
ADD https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem .
RUN keytool -noprompt -import -trustcacerts -alias aws-rds \
RUN curl https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem -o rds-combined-ca-bundle.pem && \
/opt/java/openjdk/bin/keytool -noprompt -import -trustcacerts -alias aws-rds \
-file rds-combined-ca-bundle.pem \
-keystore /etc/ssl/certs/java/cacerts \
-keypass changeit -storepass changeit
......@@ -62,11 +59,10 @@ FROM adoptopenjdk/openjdk11:alpine-jre as runner
WORKDIR /app
ENV FC_LANG en-US
ENV LC_CTYPE en_US.UTF-8
ENV FC_LANG en-US LC_CTYPE en_US.UTF-8
# dependencies
RUN apk add --no-cache bash ttf-dejavu fontconfig
RUN apk -U upgrade && apk add --no-cache bash ttf-dejavu fontconfig
# add fixed cacerts
COPY --from=builder /etc/ssl/certs/java/cacerts /opt/java/openjdk/lib/security/cacerts
......@@ -77,8 +73,7 @@ COPY --from=builder /app/source/target/uberjar/metabase.jar /app/target/uberjar/
COPY --from=builder /app/source/bin/start /app/bin/
# create the plugins directory, with writable permissions
RUN mkdir -p /plugins
RUN chmod a+rwx /plugins
RUN mkdir -p /plugins && chmod a+rwx /plugins
# expose our default runtime port
EXPOSE 3000
......
FROM adoptopenjdk/openjdk11:alpine-jre
ENV FC_LANG en-US
ENV LC_CTYPE en_US.UTF-8
ENV FC_LANG en-US LC_CTYPE en_US.UTF-8
# dependencies
RUN apk add --update --no-cache bash ttf-dejavu fontconfig
RUN apk -U upgrade && apk add --update --no-cache bash ttf-dejavu fontconfig
# add Metabase jar
COPY ./metabase.jar /app/
# add our run script to the image
COPY ./run_metabase.sh /app/
# add Metabase jar & add our run script to the image
COPY ./metabase.jar ./run_metabase.sh /app/
# create the plugins directory, with writable permissions
RUN mkdir -p /plugins
RUN chmod a+rwx /plugins
RUN mkdir -p /plugins && chmod a+rwx /plugins
# expose our default runtime port
EXPOSE 3000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment