finish examples

This commit is contained in:
tyler miller 2023-10-25 13:34:29 -04:00
parent 3f900a2f75
commit 3a7518f2ef
6 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,35 @@
FROM ubuntu:22.04 AS base
RUN apt update \
&& apt install -yq --no-install-recommends \
wget \
tar \
xz-utils \
ca-certificates \
&& rm -rf /var/lib/apt/list
#############################
FROM base AS cmake_downloader
#############################
ARG CMAKE_VERSION=3.16.5
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh \
-q --no-verbose --show-progress --progress=bar:force:noscroll -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& /tmp/cmake-install.sh --skip-license --prefix=/usr/ \
&& rm /tmp/cmake-install.sh
##############################
FROM base AS dotnet_downloader
##############################
RUN mkdir -p /dotnet \
&& wget ${WGET_ARGS} "https://download.visualstudio.microsoft.com/download/pr/904da7d0-ff02-49db-bd6b-5ea615cbdfc5/966690e36643662dcc65e3ca2423041e/dotnet-sdk-5.0.408-linux-x64.tar.gz" \
-O - | tar -xz -C /dotnet
#######################
FROM base AS aggregator
#######################
COPY --from=cmake_downloader /usr/bin/cmake /usr/
COPY --from=dotnet_downloader /dotnet /usr/dotnet

View file

@ -0,0 +1,2 @@
docker build -t multistage:demo .

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,16 @@
FROM ubuntu:22.04 AS base
RUN apt update \
&& apt install -yq --no-install-recommends \
wget \
tar \
xz-utils \
ca-certificates \
&& rm -rf /var/lib/apt/list
ARG CMAKE_VERSION=3.16.5
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh \
-q --no-verbose --show-progress --progress=bar:force:noscroll -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& /tmp/cmake-install.sh --skip-license --prefix=/usr/ \
&& rm /tmp/cmake-install.sh

View file

@ -0,0 +1,3 @@
docker compose up
docker compose run example_container

View file

@ -0,0 +1,12 @@
version: '3'
services:
example_container:
build:
context: "."
hostname: "example"
tty: true
stdin_open: true
volumes:
- ./:/source
environment:
- HELLO=world