finish examples
This commit is contained in:
parent
3f900a2f75
commit
3a7518f2ef
35
04_multistage_docker_file/Dockerfile
Normal file
35
04_multistage_docker_file/Dockerfile
Normal 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
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
docker build -t multistage:demo .
|
BIN
04_multistage_docker_file/stage_graph.png
Normal file
BIN
04_multistage_docker_file/stage_graph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
16
05_complex_run_with_compose/Dockerfile
Normal file
16
05_complex_run_with_compose/Dockerfile
Normal 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
|
|
@ -0,0 +1,3 @@
|
||||||
|
docker compose up
|
||||||
|
|
||||||
|
docker compose run example_container
|
12
05_complex_run_with_compose/docker-compose.yml
Normal file
12
05_complex_run_with_compose/docker-compose.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
example_container:
|
||||||
|
build:
|
||||||
|
context: "."
|
||||||
|
hostname: "example"
|
||||||
|
tty: true
|
||||||
|
stdin_open: true
|
||||||
|
volumes:
|
||||||
|
- ./:/source
|
||||||
|
environment:
|
||||||
|
- HELLO=world
|
Loading…
Reference in a new issue