Skip to content

Instantly share code, notes, and snippets.

@brad-jones
Created May 11, 2020 23:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brad-jones/775ff71c105a3bc1e807c60373b9a088 to your computer and use it in GitHub Desktop.
Save brad-jones/775ff71c105a3bc1e807c60373b9a088 to your computer and use it in GitHub Desktop.
apt virtual deps, like apk virtual
RUN export BUILD_PACKAGES="gnupg curl ca-certificates apt-transport-https" \
&& export EXISTING_PACKAGES="$(mktemp)" && apt-mark showauto | sort > $EXISTING_PACKAGES \
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_PACKAGES \
&& export NEW_PACKAGES="$(mktemp)" && apt-mark showauto | sort > $NEW_PACKAGES \
&& export PACKAGES_TO_REMOVE="$(comm -23 $NEW_PACKAGES $EXISTING_PACKAGES)" \
\
&& mkdir -p /usr/share/man/man1 \
&& curl -s https://apt.corretto.aws/corretto.key | apt-key add - \
&& echo 'deb https://apt.corretto.aws stable main' > /etc/apt/sources.list.d/corretto.list \
&& apt-get update && apt-get install -y --no-install-recommends java-1.8.0-amazon-corretto-jdk \
&& rm -rf /usr/share/man/man1 /etc/apt/sources.list.d/corretto.list \
&& java -version \
\
&& curl -s https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& curl -s https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list \
&& apt-get update && apt-get install -y --no-install-recommends dart \
&& rm -rf /etc/apt/sources.list.d/dart_stable.list \
&& dart --version \
\
&& pub global activate drun \
&& drun --version \
\
&& apt-get remove --purge -y $BUILD_PACKAGES $PACKAGES_TO_REMOVE \
&& rm -rf /tmp/* /var/lib/apt/lists/*;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment