SlideShare a Scribd company logo
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
$ docker pull debian:buster
buster: Pulling from library/debian
57df1a1f1ad8: Pull complete
Digest: sha256:f744ed553780b84bf376fbfe7879de9a3aece6e611af110f95ca26188cf85cb6
Status: Downloaded newer image for debian:buster
$ docker run -it debian:buster /bin/bash
$ apt-get update
$ apt-get install -y mono-runtime
$ mono --version
Mono JIT compiler version 5.18.0.240 (Debian 5.18.0.240+dfsg-3 Wed Apr 17 16:37:36 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
$ which mono
/usr/bin/mono
•
•
FROM debian:buster
RUN apt-get update
RUN apt-get install -y mono-runtime
$ docker build . -t mymono:latest
$ docker run -it mymono:latest /bin/bash
$ mono --version
Mono JIT compiler version 5.18.0.240 (Debian 5.18.0.240+dfsg-3 Wed Apr 17
16:37:36 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-
project.com
FROM debian:buster
RUN apt-get update
RUN apt-get install -y nginx
ADD nginx.conf /etc
ADD index.html /var/www
CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx.conf"]
EXPOSE 80/tcp
$ docker build . -t mynginx:latest
$ docker run -it -p 8080:80 mynginx:latest
$ docker history mynginx:latest
IMAGE CREATED CREATED BY SIZE COMMENT
029491c6130e 13 minutes ago /bin/sh -c #(nop) EXPOSE 80/tcp 0B
ec94316b9ca2 13 minutes ago /bin/sh -c #(nop) CMD ["nginx" "-g" "daemon… 0B
0bb364d192db 13 minutes ago /bin/sh -c #(nop) ADD file:18aed37573327bee1… 129B
968ebde5fb5d 13 minutes ago /bin/sh -c #(nop) ADD file:f18afd18cfe2728b3… 189B
2c29120ff52b 13 minutes ago /bin/sh -c apt-get install -y nginx 64.2MB
c4974fb27d9a 28 minutes ago /bin/sh -c apt-get update 17.5MB
f6dcff9b59af 4 days ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 days ago /bin/sh -c #(nop) ADD file:07a6578d6f507bd9c… 114MB
•
FROM debian:buster
RUN apt-get update
RUN apt-get install -y apache2
ADD index.html /var/www/html
CMD ["apachectl", "-D", "FOREGROUND"]
EXPOSE 80/tcp
$ docker history mynginx:latest
IMAGE CREATED CREATED BY SIZE COMMENT
029491c6130e 13 minutes ago /bin/sh -c #(nop) EXPOSE 80/tcp
0B
ec94316b9ca2 13 minutes ago /bin/sh -c #(nop) CMD ["nginx" "-
g" "daemon… 0B
0bb364d192db 13 minutes ago /bin/sh -c #(nop) ADD
file:18aed37573327bee1… 129B
968ebde5fb5d 13 minutes ago /bin/sh -c #(nop) ADD
file:f18afd18cfe2728b3… 189B
2c29120ff52b 13 minutes ago /bin/sh -c apt-get install -y
nginx 64.2MB
c4974fb27d9a 28 minutes ago /bin/sh -c apt-get update 17.5MB
f6dcff9b59af 4 days ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 days ago /bin/sh -c #(nop) ADD
file:07a6578d6f507bd9c… 114MB
$ docker history myapache:latest
IMAGE CREATED CREATED BY SIZE COMMENT
fc06c36e1d8b 7 minutes ago /bin/sh -c #(nop) EXPOSE 80/tcp 0B
d456baddadf5 7 minutes ago /bin/sh -c #(nop) CMD ["apachectl" "-D"
"FO… 0B
f4bbb25d31af 7 minutes ago /bin/sh -c #(nop) ADD
file:18aed37573327bee1… 129B
f7afa94e16b4 7 minutes ago /bin/sh -c apt-get install -y apache2
112MB
c4974fb27d9a 39 minutes ago /bin/sh -c apt-get update 17.5MB
f6dcff9b59af 4 days ago /bin/sh -c #(nop) CMD ["bash"] 0B
<missing> 4 days ago /bin/sh -c #(nop) ADD file:07a6578d6f507bd9c…
114MB
•
•
•
•
•
•
#!/bin/bash -e
export MONO_VERSION=5.20.1.27
wget https://download.mono-project.com/sources/mono/mono-$MONO_VERSION.tar.bz2
tar xfv mono-$MONO_VERSION.tar.bz2
cd mono-*
./autogen.sh --prefix=/app/mono --enable-minimal=aot,profiler,debug,logging 
--disable-libraries --disable-boehm --with-mcs-docs=no --with-profile2=no
make
make install
tar cfvz /out/mono-binary-tarball-$MONO_VERSION.tar.bz2 /app/mono
•
•
FROM debian:jessie
RUN apt-get update
RUN apt-get -y install wget gcc g++ bzip2 make autoconf automake libtool 
cmake python pkg-config libglib2.0-dev libcairo2-dev libpng-dev libjpeg-dev libgif-dev
ADD ./build /
CMD /build
$ docker build -t monobuildimage .
$ docker run -v $(pwd)/out:/out --rm -t monobuildimage
$ ls -lh out
total 77M
-rw-r--r-- 1 root root 77M sep 14 23:15 mono-binary-tarball-5.20.1.27.tar.bz2
•
•
•
•
•
•
•
•
•
•
{stdenv, fetchurl, libgdiplus, pkgconfig, gettext, perl, xlibs, zlib}:
stdenv.mkDerivation rec {
name = "mono-${version}";
version = "3.10.0";
src = fetchurl {
url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2";
sha256 = "1d5hib0qsmh3673k3rdd199633lmczdgpbxl6d3rnb8dh6kd2x7x";
};
buildInputs = [ pkgconfig gettext perl libgdiplus xlibs.libX11 zlib ];
NIX_LDFLAGS = "-lgcc_s" ;
dontDisableStatic = true; # To overcome the bug https://bugzilla.novell.com/show_bug.cgi?id=644723
dontStrip = true; # Fix: file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image
# Fix mono DLLMap so it can find libX11 and gdiplus to run winforms apps
postBuild = ''
find . -name 'config' -type f | while read i; do
sed -i "s@libX11.so.6@${xlibs.libX11}/lib/libX11.so.6@g" $i
sed -i '2 i<dllmap dll="gdiplus.dll" target="${libgdiplus}/lib/libgdiplus.so" os="!windows"/>' $i
done
'';
}
rec {
stdenv = ...
fetchurl = ...
xlibs = ...
gettext = ...
perl = ...
pkgconfig = import ./pkgconfig { ... };
libgdiplus = import ./libgdiplus { ... };
zlib = import ./zlib {
inherit stdenv fetchurl;
}
mono = import ./mono {
inherit stdenv fetchurl libgdiplus pkgconfig gettext perl xlibs zlib;
};
...
}
$ nix-build pkgs.nix -A mono
/nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0
$ ls -l result
lrwxrwxrwx 1 sbu sbu 55 sep 16 12:07 result ->
/nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0
$ ./result/bin/mono --version
Mono JIT compiler version 3.10.0 (tarball Tue Sep 15 08:29:10 UTC 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-
project.com
•
•
•
•
•
•
/nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0
•
•
/nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0
/nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0
•
•
•
•
•
•
•
•
•
•
$ nix-store --query --graph $(nix-instantiate pkgs.nix -A mono) > out.dot
$ dot -Tsvg out.dot > out.svg
•
•
$ nix-store -qR result
/nix/store/x76l1l04vnhw82hv6iwcvcchp3f51304-linux-headers-3.7.1
/nix/store/ikc9iziqc2rldacnbb2cdh7bdc1b2c3n-glibc-2.19
/nix/store/iyxa3l0knar229j4mbhn6a7mspp9nymd-zlib-1.2.8
...
/nix/store/whmb7k2f5xiykd3i0g26jzm16cia4s86-giflib-5.0.5
/nix/store/673zzsana5dlry0l22gwdjvyf1k30hw3-libgdiplus-2.10.9
/nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0
$ readelf -d ./result/bin/mono
Dynamic section at offset 0x3784b0 contains 32 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000f (RPATH) Library rpath: [/nix/store/ygqw3h96jg0h77r2kb6ac98caw1mchh4-gcc-4.8.3/lib/../lib64:/nix/store/ikc9iziqc2rldacnbb2cdh7bdc1b2c3n-glibc-
2.19/lib]
0x000000000000001d (RUNPATH) Library runpath: [/nix/store/ygqw3h96jg0h77r2kb6ac98caw1mchh4-gcc-4.8.3/lib/../lib64:/nix/store/ikc9iziqc2rldacnbb2cdh7bdc1b2c3n-glibc-
2.19/lib]
...
$ python --version
Python 2.7.17
$ which python
/usr/bin/python
$ nix-shell -p python3
$ python --version
Python 3.8.3
$ which python
/nix/store/f87w21b91cws0wbsvyfn5vnlyv491czi-python3-3.8.3/bin/python
•
•
•
•
•
•
•
FROM nixos/nix
RUN nix-channel --add https://nixos.org/channels/nixpkgs-
unstable nixpkgs
RUN nix-channel --update
RUN nix-env -f '<nixpkgs>' -iA nginx
RUN mkdir -p /var/log/nginx /var/cache/nginx /var/www
ADD nginx.conf /etc
ADD index.html /var/www
CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx.conf"]
EXPOSE 80/tcp
•
•
•
with import <nixpkgs> {};
dockerTools.buildImage {
name = "nginxexp";
tag = "test";
contents = nginx;
runAsRoot = ''
${dockerTools.shadowSetup}
groupadd -r nogroup
useradd -r nobody -g nogroup -d /dev/null
mkdir -p /var/log/nginx /var/cache/nginx /var/www
cp ${./index.html} /var/www/index.html
'';
config = {
Cmd = [ "${nginx}/bin/nginx" "-g" "daemon off;" "-c" ./nginx.conf ];
Expose = {
"80/tcp" = {};
};
};
}
•
•
•
$ nix-build
/nix/store/qx9cpvdxj78d98rwfk6a5z2qsmqvgzvk-docker-image-nginxexp.tar.gz
$ docker load -i result
d8847b6d0466: Loading layer
[==================================================>] 62.19MB/62.19MB
Loaded image: nginxexp:test
$ docker run -it -p 8080:80 nginxexp:test
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mynginx latest 029491c6130e 14 hours ago 196MB
nginxexp test cde8298f025f 50 years ago 61MB
•
•
•
•
•
with import <nixpkgs> {};
dockerTools.buildLayeredImage {
name = "nginxexp";
tag = "test";
contents = nginx;
maxLayers = 100;
extraCommands = ''
mkdir -p var/log/nginx var/cache/nginx var/www
cp ${./index.html} var/www/index.html
‘’;
config = {
Cmd = [ "${nginx}/bin/nginx" "-g" "daemon off;" "-c" ./nginx-root.conf ];
Expose = {
"80/tcp" = {};
};
};
}
$ docker history nginxexp:test
IMAGE CREATED CREATED BY SIZE COMMENT
b91799a04b99 50 years ago 1.47kB store paths: ['/nix/store/snxpdsksd4wxcn3niiyck0fry3wzri96-nginxexp-customisation-layer']
<missing> 50 years ago 200B store paths: ['/nix/store/6npz42nl2hhsrs98bq45aqkqsndpwvp1-nginx-root.conf']
<missing> 50 years ago 1.79MB store paths: ['/nix/store/qsq6ni4lxd8i4g9g4dvh3y7v1f43fqsp-nginx-1.18.0']
<missing> 50 years ago 492kB store paths: ['/nix/store/kdrdxhswaqm4dgdqs1vs2l4b4md7djma-pcre-8.44']
<missing> 50 years ago 4.17MB store paths: ['/nix/store/6glpgx3pypxzb09wxdqyagv33rrj03qp-openssl-1.1.1g']
...
<missing> 50 years ago 123kB store paths: ['/nix/store/5x6l9xm5dp6v113dpfv673qvhwjyb7p5-zlib-1.2.11']
<missing> 50 years ago 30.9MB store paths: ['/nix/store/bqbg6hb2jsl3kvf6jgmgfdqy06fpjrrn-glibc-2.30']
<missing> 50 years ago 209kB store paths: ['/nix/store/fhg84pzckx2igmcsvg92x1wpvl1dmybf-libidn2-2.3.0']
<missing> 50 years ago 1.63MB store paths: ['/nix/store/y8n2b9nwjrgfx3kvi3vywvfib2cw5xa6-libunistring-0.9.10']
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•

More Related Content

What's hot

Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計
Koichi Nagaoka
 
CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015
Brandon Philips
 
Delivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and DockerDelivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and Docker
Jorrit Salverda
 
QNAP COSCUP Container Station
QNAP COSCUP Container StationQNAP COSCUP Container Station
QNAP COSCUP Container Station
Wu Fan-Cheng
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)
Julien SIMON
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
HungWei Chiu
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a Nutshell
CoreOS
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
Consuming Cinder from Docker
Consuming Cinder from DockerConsuming Cinder from Docker
Consuming Cinder from Docker
John Griffith
 
15 kubernetes failure points you should watch
15 kubernetes failure points you should watch15 kubernetes failure points you should watch
15 kubernetes failure points you should watch
Sysdig
 
Building a Docker v1.12 Swarm cluster on ARM
Building a Docker v1.12 Swarm cluster on ARMBuilding a Docker v1.12 Swarm cluster on ARM
Building a Docker v1.12 Swarm cluster on ARM
Team Hypriot
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge
Nicolas De Loof
 
Networking and Go: An Engineer's Journey (Strangeloop 2019)
Networking and Go: An Engineer's Journey (Strangeloop 2019)Networking and Go: An Engineer's Journey (Strangeloop 2019)
Networking and Go: An Engineer's Journey (Strangeloop 2019)
Sneha Inguva
 
Docker composeで開発環境をメンバに配布せよ
Docker composeで開発環境をメンバに配布せよDocker composeで開発環境をメンバに配布せよ
Docker composeで開発環境をメンバに配布せよ
Yusuke Kon
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
Victor S. Recio
 
Enjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and HelmEnjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and Helm
ロフト くん
 
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
Atlassian
 
What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?
Docker, Inc.
 
Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for Dummies
Łukasz Proszek
 
Paris container day june17
Paris container day   june17Paris container day   june17
Paris container day june17
Paris Container Day
 

What's hot (20)

Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計Dockerを利用したローカル環境から本番環境までの構築設計
Dockerを利用したローカル環境から本番環境までの構築設計
 
CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015
 
Delivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and DockerDelivering Go.CD with Terraform and Docker
Delivering Go.CD with Terraform and Docker
 
QNAP COSCUP Container Station
QNAP COSCUP Container StationQNAP COSCUP Container Station
QNAP COSCUP Container Station
 
Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)Advanced Task Scheduling with Amazon ECS (June 2017)
Advanced Task Scheduling with Amazon ECS (June 2017)
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a Nutshell
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Consuming Cinder from Docker
Consuming Cinder from DockerConsuming Cinder from Docker
Consuming Cinder from Docker
 
15 kubernetes failure points you should watch
15 kubernetes failure points you should watch15 kubernetes failure points you should watch
15 kubernetes failure points you should watch
 
Building a Docker v1.12 Swarm cluster on ARM
Building a Docker v1.12 Swarm cluster on ARMBuilding a Docker v1.12 Swarm cluster on ARM
Building a Docker v1.12 Swarm cluster on ARM
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge
 
Networking and Go: An Engineer's Journey (Strangeloop 2019)
Networking and Go: An Engineer's Journey (Strangeloop 2019)Networking and Go: An Engineer's Journey (Strangeloop 2019)
Networking and Go: An Engineer's Journey (Strangeloop 2019)
 
Docker composeで開発環境をメンバに配布せよ
Docker composeで開発環境をメンバに配布せよDocker composeで開発環境をメンバに配布せよ
Docker composeで開発環境をメンバに配布せよ
 
Docker up and running
Docker up and runningDocker up and running
Docker up and running
 
Enjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and HelmEnjoying k8s cluster with Minikube and Helm
Enjoying k8s cluster with Minikube and Helm
 
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
 
What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?
 
Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for Dummies
 
Paris container day june17
Paris container day   june17Paris container day   june17
Paris container day june17
 

Similar to Using Nix and Docker as automated deployment solutions

Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
Docker, Inc.
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK Seminar
Martin Scharm
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
Przemyslaw Koltermann
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
Przemyslaw Koltermann
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration training
Steve Smith
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Herokuronnywang_tw
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Ontico
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
Software Guru
 
Docker practice
Docker practiceDocker practice
Docker practice
wonyong hwang
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
Docker, Inc.
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
Steve Smith
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
Giacomo Bagnoli
 
Be a better developer with Docker (revision 3)
Be a better developer with Docker (revision 3)Be a better developer with Docker (revision 3)
Be a better developer with Docker (revision 3)
Nicola Paolucci
 
Builder and BuildKit
Builder and BuildKitBuilder and BuildKit
Builder and BuildKit
Moby Project
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
Fabio Kung
 
Hands-On Session Docker
Hands-On Session DockerHands-On Session Docker
Hands-On Session Docker
LinetsChile
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
KAI CHU CHUNG
 
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
Amazon Web Services
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
Alexandre Salomé
 

Similar to Using Nix and Docker as automated deployment solutions (20)

Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK Seminar
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration training
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Docker practice
Docker practiceDocker practice
Docker practice
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Be a better developer with Docker (revision 3)
Be a better developer with Docker (revision 3)Be a better developer with Docker (revision 3)
Be a better developer with Docker (revision 3)
 
Builder and BuildKit
Builder and BuildKitBuilder and BuildKit
Builder and BuildKit
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
Hands-On Session Docker
Hands-On Session DockerHands-On Session Docker
Hands-On Session Docker
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
 
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 

More from Sander van der Burg

The Monitoring Playground
The Monitoring PlaygroundThe Monitoring Playground
The Monitoring Playground
Sander van der Burg
 
Dysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deploymentDysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deployment
Sander van der Burg
 
The NixOS project and deploying systems declaratively
The NixOS project and deploying systems declarativelyThe NixOS project and deploying systems declaratively
The NixOS project and deploying systems declaratively
Sander van der Burg
 
Deploying (micro)services with Disnix
Deploying (micro)services with DisnixDeploying (micro)services with Disnix
Deploying (micro)services with Disnix
Sander van der Burg
 
Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsHydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The Details
Sander van der Burg
 
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsHydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Sander van der Burg
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
Sander van der Burg
 
The Nix project
The Nix projectThe Nix project
The Nix project
Sander van der Burg
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
Sander van der Burg
 
Techniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesTechniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processes
Sander van der Burg
 
The Nix project
The Nix projectThe Nix project
The Nix project
Sander van der Burg
 
A Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsA Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software Components
Sander van der Burg
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with Disnix
Sander van der Burg
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented Systems
Sander van der Burg
 
Using NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testingUsing NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testing
Sander van der Burg
 
Pull Deployment of Services
Pull Deployment of ServicesPull Deployment of Services
Pull Deployment of Services
Sander van der Burg
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deployment
Sander van der Burg
 
Automated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemAutomated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented System
Sander van der Burg
 
Deploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerDeploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package manager
Sander van der Burg
 
Pull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesPull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and Challenges
Sander van der Burg
 

More from Sander van der Burg (20)

The Monitoring Playground
The Monitoring PlaygroundThe Monitoring Playground
The Monitoring Playground
 
Dysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deploymentDysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deployment
 
The NixOS project and deploying systems declaratively
The NixOS project and deploying systems declarativelyThe NixOS project and deploying systems declaratively
The NixOS project and deploying systems declaratively
 
Deploying (micro)services with Disnix
Deploying (micro)services with DisnixDeploying (micro)services with Disnix
Deploying (micro)services with Disnix
 
Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsHydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The Details
 
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsHydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The Basics
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
The Nix project
The Nix projectThe Nix project
The Nix project
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
Techniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesTechniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processes
 
The Nix project
The Nix projectThe Nix project
The Nix project
 
A Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software ComponentsA Generic Approach for Deploying and Upgrading Mutable Software Components
A Generic Approach for Deploying and Upgrading Mutable Software Components
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with Disnix
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented Systems
 
Using NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testingUsing NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testing
 
Pull Deployment of Services
Pull Deployment of ServicesPull Deployment of Services
Pull Deployment of Services
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deployment
 
Automated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemAutomated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented System
 
Deploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerDeploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package manager
 
Pull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesPull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and Challenges
 

Recently uploaded

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 

Recently uploaded (20)

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 

Using Nix and Docker as automated deployment solutions

  • 1.
  • 2.
  • 3.
  • 5.
  • 6.
  • 7.
  • 8.
  • 12. $ docker pull debian:buster buster: Pulling from library/debian 57df1a1f1ad8: Pull complete Digest: sha256:f744ed553780b84bf376fbfe7879de9a3aece6e611af110f95ca26188cf85cb6 Status: Downloaded newer image for debian:buster $ docker run -it debian:buster /bin/bash $ apt-get update $ apt-get install -y mono-runtime $ mono --version Mono JIT compiler version 5.18.0.240 (Debian 5.18.0.240+dfsg-3 Wed Apr 17 16:37:36 UTC 2019) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com $ which mono /usr/bin/mono
  • 13. • • FROM debian:buster RUN apt-get update RUN apt-get install -y mono-runtime
  • 14. $ docker build . -t mymono:latest $ docker run -it mymono:latest /bin/bash $ mono --version Mono JIT compiler version 5.18.0.240 (Debian 5.18.0.240+dfsg-3 Wed Apr 17 16:37:36 UTC 2019) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono- project.com
  • 15. FROM debian:buster RUN apt-get update RUN apt-get install -y nginx ADD nginx.conf /etc ADD index.html /var/www CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx.conf"] EXPOSE 80/tcp $ docker build . -t mynginx:latest $ docker run -it -p 8080:80 mynginx:latest
  • 16. $ docker history mynginx:latest IMAGE CREATED CREATED BY SIZE COMMENT 029491c6130e 13 minutes ago /bin/sh -c #(nop) EXPOSE 80/tcp 0B ec94316b9ca2 13 minutes ago /bin/sh -c #(nop) CMD ["nginx" "-g" "daemon… 0B 0bb364d192db 13 minutes ago /bin/sh -c #(nop) ADD file:18aed37573327bee1… 129B 968ebde5fb5d 13 minutes ago /bin/sh -c #(nop) ADD file:f18afd18cfe2728b3… 189B 2c29120ff52b 13 minutes ago /bin/sh -c apt-get install -y nginx 64.2MB c4974fb27d9a 28 minutes ago /bin/sh -c apt-get update 17.5MB f6dcff9b59af 4 days ago /bin/sh -c #(nop) CMD ["bash"] 0B <missing> 4 days ago /bin/sh -c #(nop) ADD file:07a6578d6f507bd9c… 114MB
  • 17. • FROM debian:buster RUN apt-get update RUN apt-get install -y apache2 ADD index.html /var/www/html CMD ["apachectl", "-D", "FOREGROUND"] EXPOSE 80/tcp
  • 18. $ docker history mynginx:latest IMAGE CREATED CREATED BY SIZE COMMENT 029491c6130e 13 minutes ago /bin/sh -c #(nop) EXPOSE 80/tcp 0B ec94316b9ca2 13 minutes ago /bin/sh -c #(nop) CMD ["nginx" "- g" "daemon… 0B 0bb364d192db 13 minutes ago /bin/sh -c #(nop) ADD file:18aed37573327bee1… 129B 968ebde5fb5d 13 minutes ago /bin/sh -c #(nop) ADD file:f18afd18cfe2728b3… 189B 2c29120ff52b 13 minutes ago /bin/sh -c apt-get install -y nginx 64.2MB c4974fb27d9a 28 minutes ago /bin/sh -c apt-get update 17.5MB f6dcff9b59af 4 days ago /bin/sh -c #(nop) CMD ["bash"] 0B <missing> 4 days ago /bin/sh -c #(nop) ADD file:07a6578d6f507bd9c… 114MB $ docker history myapache:latest IMAGE CREATED CREATED BY SIZE COMMENT fc06c36e1d8b 7 minutes ago /bin/sh -c #(nop) EXPOSE 80/tcp 0B d456baddadf5 7 minutes ago /bin/sh -c #(nop) CMD ["apachectl" "-D" "FO… 0B f4bbb25d31af 7 minutes ago /bin/sh -c #(nop) ADD file:18aed37573327bee1… 129B f7afa94e16b4 7 minutes ago /bin/sh -c apt-get install -y apache2 112MB c4974fb27d9a 39 minutes ago /bin/sh -c apt-get update 17.5MB f6dcff9b59af 4 days ago /bin/sh -c #(nop) CMD ["bash"] 0B <missing> 4 days ago /bin/sh -c #(nop) ADD file:07a6578d6f507bd9c… 114MB
  • 21. #!/bin/bash -e export MONO_VERSION=5.20.1.27 wget https://download.mono-project.com/sources/mono/mono-$MONO_VERSION.tar.bz2 tar xfv mono-$MONO_VERSION.tar.bz2 cd mono-* ./autogen.sh --prefix=/app/mono --enable-minimal=aot,profiler,debug,logging --disable-libraries --disable-boehm --with-mcs-docs=no --with-profile2=no make make install tar cfvz /out/mono-binary-tarball-$MONO_VERSION.tar.bz2 /app/mono
  • 22. • • FROM debian:jessie RUN apt-get update RUN apt-get -y install wget gcc g++ bzip2 make autoconf automake libtool cmake python pkg-config libglib2.0-dev libcairo2-dev libpng-dev libjpeg-dev libgif-dev ADD ./build / CMD /build
  • 23. $ docker build -t monobuildimage . $ docker run -v $(pwd)/out:/out --rm -t monobuildimage $ ls -lh out total 77M -rw-r--r-- 1 root root 77M sep 14 23:15 mono-binary-tarball-5.20.1.27.tar.bz2
  • 26.
  • 28. {stdenv, fetchurl, libgdiplus, pkgconfig, gettext, perl, xlibs, zlib}: stdenv.mkDerivation rec { name = "mono-${version}"; version = "3.10.0"; src = fetchurl { url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2"; sha256 = "1d5hib0qsmh3673k3rdd199633lmczdgpbxl6d3rnb8dh6kd2x7x"; }; buildInputs = [ pkgconfig gettext perl libgdiplus xlibs.libX11 zlib ]; NIX_LDFLAGS = "-lgcc_s" ; dontDisableStatic = true; # To overcome the bug https://bugzilla.novell.com/show_bug.cgi?id=644723 dontStrip = true; # Fix: file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image # Fix mono DLLMap so it can find libX11 and gdiplus to run winforms apps postBuild = '' find . -name 'config' -type f | while read i; do sed -i "s@libX11.so.6@${xlibs.libX11}/lib/libX11.so.6@g" $i sed -i '2 i<dllmap dll="gdiplus.dll" target="${libgdiplus}/lib/libgdiplus.so" os="!windows"/>' $i done ''; }
  • 29. rec { stdenv = ... fetchurl = ... xlibs = ... gettext = ... perl = ... pkgconfig = import ./pkgconfig { ... }; libgdiplus = import ./libgdiplus { ... }; zlib = import ./zlib { inherit stdenv fetchurl; } mono = import ./mono { inherit stdenv fetchurl libgdiplus pkgconfig gettext perl xlibs zlib; }; ... }
  • 30. $ nix-build pkgs.nix -A mono /nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0 $ ls -l result lrwxrwxrwx 1 sbu sbu 55 sep 16 12:07 result -> /nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0 $ ./result/bin/mono --version Mono JIT compiler version 3.10.0 (tarball Tue Sep 15 08:29:10 UTC 2020) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono- project.com
  • 35. $ nix-store --query --graph $(nix-instantiate pkgs.nix -A mono) > out.dot $ dot -Tsvg out.dot > out.svg
  • 36. • • $ nix-store -qR result /nix/store/x76l1l04vnhw82hv6iwcvcchp3f51304-linux-headers-3.7.1 /nix/store/ikc9iziqc2rldacnbb2cdh7bdc1b2c3n-glibc-2.19 /nix/store/iyxa3l0knar229j4mbhn6a7mspp9nymd-zlib-1.2.8 ... /nix/store/whmb7k2f5xiykd3i0g26jzm16cia4s86-giflib-5.0.5 /nix/store/673zzsana5dlry0l22gwdjvyf1k30hw3-libgdiplus-2.10.9 /nix/store/0fkqp394m1pfzvjcrn4jisi0sm5c0q8n-mono-3.10.0
  • 37. $ readelf -d ./result/bin/mono Dynamic section at offset 0x3784b0 contains 32 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] 0x0000000000000001 (NEEDED) Shared library: [librt.so.1] 0x0000000000000001 (NEEDED) Shared library: [libdl.so.2] 0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x000000000000000f (RPATH) Library rpath: [/nix/store/ygqw3h96jg0h77r2kb6ac98caw1mchh4-gcc-4.8.3/lib/../lib64:/nix/store/ikc9iziqc2rldacnbb2cdh7bdc1b2c3n-glibc- 2.19/lib] 0x000000000000001d (RUNPATH) Library runpath: [/nix/store/ygqw3h96jg0h77r2kb6ac98caw1mchh4-gcc-4.8.3/lib/../lib64:/nix/store/ikc9iziqc2rldacnbb2cdh7bdc1b2c3n-glibc- 2.19/lib] ...
  • 38. $ python --version Python 2.7.17 $ which python /usr/bin/python $ nix-shell -p python3 $ python --version Python 3.8.3 $ which python /nix/store/f87w21b91cws0wbsvyfn5vnlyv491czi-python3-3.8.3/bin/python
  • 40.
  • 41. • • • FROM nixos/nix RUN nix-channel --add https://nixos.org/channels/nixpkgs- unstable nixpkgs RUN nix-channel --update RUN nix-env -f '<nixpkgs>' -iA nginx RUN mkdir -p /var/log/nginx /var/cache/nginx /var/www ADD nginx.conf /etc ADD index.html /var/www CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx.conf"] EXPOSE 80/tcp
  • 43. with import <nixpkgs> {}; dockerTools.buildImage { name = "nginxexp"; tag = "test"; contents = nginx; runAsRoot = '' ${dockerTools.shadowSetup} groupadd -r nogroup useradd -r nobody -g nogroup -d /dev/null mkdir -p /var/log/nginx /var/cache/nginx /var/www cp ${./index.html} /var/www/index.html ''; config = { Cmd = [ "${nginx}/bin/nginx" "-g" "daemon off;" "-c" ./nginx.conf ]; Expose = { "80/tcp" = {}; }; }; }
  • 44. • • • $ nix-build /nix/store/qx9cpvdxj78d98rwfk6a5z2qsmqvgzvk-docker-image-nginxexp.tar.gz $ docker load -i result d8847b6d0466: Loading layer [==================================================>] 62.19MB/62.19MB Loaded image: nginxexp:test $ docker run -it -p 8080:80 nginxexp:test
  • 45. $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE mynginx latest 029491c6130e 14 hours ago 196MB nginxexp test cde8298f025f 50 years ago 61MB
  • 47. with import <nixpkgs> {}; dockerTools.buildLayeredImage { name = "nginxexp"; tag = "test"; contents = nginx; maxLayers = 100; extraCommands = '' mkdir -p var/log/nginx var/cache/nginx var/www cp ${./index.html} var/www/index.html ‘’; config = { Cmd = [ "${nginx}/bin/nginx" "-g" "daemon off;" "-c" ./nginx-root.conf ]; Expose = { "80/tcp" = {}; }; }; }
  • 48. $ docker history nginxexp:test IMAGE CREATED CREATED BY SIZE COMMENT b91799a04b99 50 years ago 1.47kB store paths: ['/nix/store/snxpdsksd4wxcn3niiyck0fry3wzri96-nginxexp-customisation-layer'] <missing> 50 years ago 200B store paths: ['/nix/store/6npz42nl2hhsrs98bq45aqkqsndpwvp1-nginx-root.conf'] <missing> 50 years ago 1.79MB store paths: ['/nix/store/qsq6ni4lxd8i4g9g4dvh3y7v1f43fqsp-nginx-1.18.0'] <missing> 50 years ago 492kB store paths: ['/nix/store/kdrdxhswaqm4dgdqs1vs2l4b4md7djma-pcre-8.44'] <missing> 50 years ago 4.17MB store paths: ['/nix/store/6glpgx3pypxzb09wxdqyagv33rrj03qp-openssl-1.1.1g'] ... <missing> 50 years ago 123kB store paths: ['/nix/store/5x6l9xm5dp6v113dpfv673qvhwjyb7p5-zlib-1.2.11'] <missing> 50 years ago 30.9MB store paths: ['/nix/store/bqbg6hb2jsl3kvf6jgmgfdqy06fpjrrn-glibc-2.30'] <missing> 50 years ago 209kB store paths: ['/nix/store/fhg84pzckx2igmcsvg92x1wpvl1dmybf-libidn2-2.3.0'] <missing> 50 years ago 1.63MB store paths: ['/nix/store/y8n2b9nwjrgfx3kvi3vywvfib2cw5xa6-libunistring-0.9.10']