-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a `bin` image containing simply the Deno binary on a `scratch` image.
- Loading branch information
Showing
8 changed files
with
132 additions
and
81 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
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,23 @@ | ||
ARG DENO_VERSION=1.13.2 | ||
|
||
|
||
FROM ubuntu:20.04 AS download | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y curl unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG DENO_VERSION | ||
RUN curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip \ | ||
--output deno.zip \ | ||
&& unzip deno.zip \ | ||
&& rm deno.zip \ | ||
&& chmod 755 deno | ||
|
||
|
||
FROM scratch | ||
|
||
ARG DENO_VERSION | ||
ENV DENO_VERSION=${DENO_VERSION} | ||
|
||
COPY --from=download /deno /deno |
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,31 +1,25 @@ | ||
FROM debian:stable-slim | ||
ARG DENO_VERSION=1.13.2 | ||
ARG BIN_IMAGE=denoland/deno:bin-${DENO_VERSION} | ||
|
||
|
||
ENV DENO_VERSION=1.13.2 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get -qq update \ | ||
&& apt-get -qq install -y --no-install-recommends curl ca-certificates unzip \ | ||
&& curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip \ | ||
--output deno.zip \ | ||
&& unzip deno.zip \ | ||
&& rm deno.zip \ | ||
&& chmod 755 deno \ | ||
&& mv deno /usr/bin/deno \ | ||
&& apt-get -qq remove --purge -y curl ca-certificates unzip \ | ||
&& apt-get -y -qq autoremove \ | ||
&& apt-get -qq clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
FROM ${BIN_IMAGE} AS bin | ||
|
||
|
||
FROM debian:stable-slim | ||
|
||
RUN useradd --uid 1993 --user-group deno \ | ||
&& mkdir /deno-dir/ \ | ||
&& chown deno:deno /deno-dir/ | ||
&& mkdir /deno-dir/ \ | ||
&& chown deno:deno /deno-dir/ | ||
|
||
ENV DENO_DIR /deno-dir/ | ||
ENV DENO_INSTALL_ROOT /usr/local | ||
|
||
ARG DENO_VERSION | ||
ENV DENO_VERSION=${DENO_VERSION} | ||
COPY --from=bin /deno /usr/bin/deno | ||
|
||
COPY ./_entry.sh /usr/local/bin/docker-entrypoint.sh | ||
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh | ||
|
||
|
||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
CMD ["run", "https://deno.land/std/examples/welcome.ts"] |
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,25 +1,18 @@ | ||
FROM alpine:3.12.3 | ||
ARG DENO_VERSION=1.13.2 | ||
ARG BIN_IMAGE=denoland/deno:bin-${DENO_VERSION} | ||
|
||
ENV DENO_VERSION=1.13.2 | ||
|
||
RUN apk add --virtual .download --no-cache curl \ | ||
&& curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip \ | ||
--output deno.zip \ | ||
&& unzip deno.zip \ | ||
&& rm deno.zip \ | ||
&& chmod 755 deno \ | ||
&& mv deno /bin/deno \ | ||
&& apk del .download | ||
FROM ${BIN_IMAGE} AS bin | ||
|
||
|
||
FROM gcr.io/distroless/cc | ||
COPY --from=0 /bin/deno /bin/deno | ||
|
||
ENV DENO_VERSION=1.13.2 | ||
ENV DENO_DIR /deno-dir/ | ||
ENV DENO_INSTALL_ROOT /usr/local | ||
|
||
ARG DENO_VERSION | ||
ENV DENO_VERSION=${DENO_VERSION} | ||
COPY --from=bin /deno /bin/deno | ||
|
||
ENTRYPOINT ["/bin/deno"] | ||
CMD ["run", "https://deno.land/std/examples/welcome.ts"] | ||
|
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,31 +1,25 @@ | ||
FROM ubuntu:20.04 | ||
ARG DENO_VERSION=1.13.2 | ||
ARG BIN_IMAGE=denoland/deno:bin-${DENO_VERSION} | ||
|
||
|
||
ENV DENO_VERSION=1.13.2 | ||
|
||
RUN apt-get -qq update \ | ||
&& apt-get upgrade -y -o Dpkg::Options::="--force-confold" \ | ||
&& apt-get -qq install -y ca-certificates curl unzip --no-install-recommends \ | ||
&& curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip \ | ||
--output deno.zip \ | ||
&& unzip deno.zip \ | ||
&& rm deno.zip \ | ||
&& chmod 755 deno \ | ||
&& mv deno /usr/bin/deno \ | ||
&& apt-get -qq remove -y ca-certificates curl unzip \ | ||
&& apt-get -y -qq autoremove \ | ||
&& apt-get -qq clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
FROM ${BIN_IMAGE} AS bin | ||
|
||
|
||
FROM ubuntu:20.04 | ||
|
||
RUN useradd --uid 1993 --user-group deno \ | ||
&& mkdir /deno-dir/ \ | ||
&& chown deno:deno /deno-dir/ | ||
&& mkdir /deno-dir/ \ | ||
&& chown deno:deno /deno-dir/ | ||
|
||
ENV DENO_DIR /deno-dir/ | ||
ENV DENO_INSTALL_ROOT /usr/local | ||
|
||
ARG DENO_VERSION | ||
ENV DENO_VERSION=${DENO_VERSION} | ||
COPY --from=bin /deno /usr/bin/deno | ||
|
||
COPY ./_entry.sh /usr/local/bin/docker-entrypoint.sh | ||
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh | ||
|
||
|
||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
CMD ["run", "https://deno.land/std/examples/welcome.ts"] |