<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>docker on Rise-</title><link>https://madil.in/tag/docker/</link><description>Recent content in docker on Rise-</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 27 Jul 2023 03:57:24 +0000</lastBuildDate><atom:link href="https://madil.in/tag/docker/index.xml" rel="self" type="application/rss+xml"/><item><title>TIL - Tracing Syscalls using Aquasec Tracee</title><link>https://madil.in/til-tracing-syscalls-using-aquasec-tracee/</link><pubDate>Sat, 12 Nov 2022 08:30:23 +0000</pubDate><guid>https://madil.in/til-tracing-syscalls-using-aquasec-tracee/</guid><description>&lt;p&gt;To check all the syscalls made from a container use the Tracee tool developed by Aqua Security.&lt;/p&gt;&#10;&lt;p&gt;Below docker run command will trace all the new syscalls made from new containers.&lt;/p&gt;&#10;&lt;div class="code-block not-prose group relative my-7" x-data="copy(function () { return this.$root.querySelector('pre').innerText })"&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;docker run --name tracee --rm --privileged \&#10; -v /lib/modules/:/lib/modules/:ro \&#10; -v /usr/src:/usr/src:ro -v /tmp/tracee:/tmp/tracee -it \&#10; aquasec/tracee:0.4.0 --trace container=new&lt;/code&gt;&lt;/pre&gt;&lt;div class="absolute right-2 top-2 flex items-center gap-2"&gt;&#10; &lt;button type="button" @click="copy()" data-track="code_copied" data-track-props='{&amp;#34;language&amp;#34;:&amp;#34;text&amp;#34;}' class="absolute right-0 flex items-center gap-1 rounded-md bg-white/10 px-2 py-1 text-xs text-white/80 opacity-0 transition-opacity hover:bg-white/20 focus:opacity-100 group-hover:opacity-100"&gt;&#10; &lt;span x-text="copied ? 'Copied' : 'Copy'"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;a class="bookmark-card" href="https://github.com/aquasecurity/tracee" target="_blank" rel="noopener"&gt;&#10; &lt;span class="bookmark-content"&gt;&#10; &lt;span class="bookmark-title"&gt;GitHub - aquasecurity/tracee: Linux Runtime Security and Forensics using eBPF&lt;/span&gt;&lt;span class="bookmark-description"&gt;Linux Runtime Security and Forensics using eBPF. Contribute to aquasecurity/tracee development by creating an account on GitHub.&lt;/span&gt;&#10; &lt;span class="bookmark-meta"&gt;&lt;img class="bookmark-icon" src="https://github.com/fluidicon.png" alt="" loading="lazy"&gt;&lt;span&gt;aquasecurity&lt;/span&gt;&#10; &lt;/span&gt;&#10; &lt;/span&gt;&lt;span class="bookmark-thumb"&gt;&lt;img src="https://opengraph.githubassets.com/6f23fbe07e784db031aa7b211bfe511094104455d02cf4dc8adf6b8ff83f3508/aquasecurity/tracee" alt="" loading="lazy"&gt;&lt;/span&gt;&lt;/a&gt;</description></item><item><title>Building smaller secure docker images with Multi-Stage builds - Part II</title><link>https://madil.in/building-smaller-secure-docker-images-with-multi-stage-builds-part-ii/</link><pubDate>Wed, 10 Jul 2019 18:30:00 +0000</pubDate><guid>https://madil.in/building-smaller-secure-docker-images-with-multi-stage-builds-part-ii/</guid><description>&lt;p&gt;In this post, we checked how we can build smaller and secure docker images using multi-stage builds. In that post I missed one important factor that contributes to building smaller images. Let us check what it is.&lt;/p&gt;&#10;&lt;p&gt;This is the most simple way to reduce images sizes of our applications. In project&amp;rsquo;s root directory we can add a &lt;code&gt;.dockerignore&lt;/code&gt; file. This will have a list of files or directories which we do not want in our final docker image. Let us take an example of a Node.js project -&lt;/p&gt;</description></item><item><title>Building smaller secure docker images with Multi-Stage builds</title><link>https://madil.in/building-smaller-secure-docker-images-with-multi-stage-builds/</link><pubDate>Tue, 09 Apr 2019 18:30:00 +0000</pubDate><guid>https://madil.in/building-smaller-secure-docker-images-with-multi-stage-builds/</guid><description>&lt;p&gt;Docker v17.05 introduced multi-stage builds giving us more ways to package and secure our applications. This post will show you how to use the power of the multi-stage builds for your projects. Check out the below Dockerfile and try to guess what we are trying to achieve here. We will go through each of the steps in detail right after that.&lt;/p&gt;&#10;&lt;div class="code-block not-prose group relative my-7" x-data="copy(function () { return this.$root.querySelector('pre').innerText })"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-dockerfile" data-lang="dockerfile"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7f848e"&gt;# Step 1&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;FROM&lt;/span&gt; &lt;span style="color:#98c379"&gt;node:10-alpine&lt;/span&gt; &lt;span style="color:#c678dd"&gt;AS&lt;/span&gt; &lt;span style="color:#98c379"&gt;base&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;WORKDIR&lt;/span&gt; &lt;span style="color:#98c379"&gt;/app&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;COPY&lt;/span&gt; package.json .&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7f848e"&gt;# Step 2&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;FROM&lt;/span&gt; &lt;span style="color:#98c379"&gt;base&lt;/span&gt; &lt;span style="color:#c678dd"&gt;AS&lt;/span&gt; &lt;span style="color:#98c379"&gt;dependencies&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;RUN&lt;/span&gt; npm install --only&lt;span style="color:#56b6c2"&gt;=&lt;/span&gt;production&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;RUN&lt;/span&gt; cp -R node_modules prod_node_modules&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;RUN&lt;/span&gt; npm install&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7f848e"&gt;# Step 3&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;FROM&lt;/span&gt; &lt;span style="color:#98c379"&gt;dependencies&lt;/span&gt; &lt;span style="color:#c678dd"&gt;AS&lt;/span&gt; &lt;span style="color:#98c379"&gt;build&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;COPY&lt;/span&gt; . .&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;RUN&lt;/span&gt; npm run build&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7f848e"&gt;# Step 4&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;FROM&lt;/span&gt; &lt;span style="color:#98c379"&gt;base&lt;/span&gt; &lt;span style="color:#c678dd"&gt;AS&lt;/span&gt; &lt;span style="color:#98c379"&gt;final&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;COPY&lt;/span&gt; --from&lt;span style="color:#56b6c2"&gt;=&lt;/span&gt;dependencies /app/prod_node_modules ./node_modules&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;COPY&lt;/span&gt; --from&lt;span style="color:#56b6c2"&gt;=&lt;/span&gt;build /app/dist ./dist&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;COPY&lt;/span&gt; --from&lt;span style="color:#56b6c2"&gt;=&lt;/span&gt;build /app/entrypoint entrypoint&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;RUN&lt;/span&gt; chmod +x entrypoint&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;EXPOSE&lt;/span&gt; &lt;span style="color:#98c379"&gt;3000&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#c678dd"&gt;ENTRYPOINT&lt;/span&gt; [ &lt;span style="color:#98c379"&gt;&amp;#34;sh&amp;#34;&lt;/span&gt;, &lt;span style="color:#98c379"&gt;&amp;#34;entrypoint&amp;#34;&lt;/span&gt; ]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="absolute right-2 top-2 flex items-center gap-2"&gt;&lt;span class="select-none text-xs uppercase tracking-wider text-white/40 transition-opacity group-hover:opacity-0"&gt;dockerfile&lt;/span&gt;&#10; &lt;button type="button" @click="copy()" data-track="code_copied" data-track-props='{&amp;#34;language&amp;#34;:&amp;#34;dockerfile&amp;#34;}' class="absolute right-0 flex items-center gap-1 rounded-md bg-white/10 px-2 py-1 text-xs text-white/80 opacity-0 transition-opacity hover:bg-white/20 focus:opacity-100 group-hover:opacity-100"&gt;&#10; &lt;span x-text="copied ? 'Copied' : 'Copy'"&gt;Copy&lt;/span&gt;&#10; &lt;/button&gt;&#10; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Now let us go through the multiple stages we have used to create our final image -&lt;/p&gt;</description></item><item><title>Useful links - Software Orchestration Edition</title><link>https://madil.in/useful-links-software-orchestration-edition/</link><pubDate>Fri, 21 Jul 2017 18:30:00 +0000</pubDate><guid>https://madil.in/useful-links-software-orchestration-edition/</guid><description>&lt;h3 id="git"&gt;git&lt;/h3&gt;&#10;&lt;p&gt;Most commonly used git tips and tricks - &lt;a href="https://github.com/git-tips/tips"&gt;Git-tips&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="ansible"&gt;ansible&lt;/h3&gt;&#10;&lt;p&gt;Automating Django Deployments With Fabric and Ansible - &lt;a href="https://realpython.com/blog/python/automating-django-deployments-with-fabric-and-ansible/"&gt;Realpython.com blog&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="docker"&gt;docker&lt;/h3&gt;&#10;&lt;p&gt;A handy CLI in Docker container to make optimum use of git tips - &lt;a href="https://github.com/djoudi5/docker-git-tip"&gt;Docker git-tips&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Docker 101 workshop - introduction to Docker and basic concepts -&lt;br&gt;&#10;&lt;a href="https://github.com/gravitational/workshop/blob/master/docker.md"&gt;Gravitational Workshops - docker&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Build and deploying heroku apps with docker - &lt;a href="https://blog.heroku.com/introducing_heroku_docker_release_build_deploy_heroku_apps_with_docker"&gt;Heroku + Docker&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="kubernetes"&gt;kubernetes&lt;/h3&gt;&#10;&lt;p&gt;Kubernetes 101 workshop - introduction to Kubernetes and basic concepts -  &lt;a href="https://github.com/gravitational/workshop/blob/master/k8s101.md"&gt;Gravitational Workshops - kubernetes&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>