Skip to content

Instantly share code, notes, and snippets.

Mistakes to Avoid: Docker Antipatterns

Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.

Don’t run too many processes inside a single container

The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.

Don’t install operating systems inside Docker containers

It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential

@nom3ad
nom3ad / bookmarklets.md
Created December 28, 2022 16:24 — forked from ElectricRCAircraftGuy/bookmarklets.md
These are bookmarklets (ie: browser bookmarks with Javascript in them) to perform functions to help make your GitHub PR review life easier.
@nom3ad
nom3ad / eols.sh
Created September 2, 2022 08:25 — forked from byroot/eols.sh
Convert the whole git history with dos2unix
git filter-branch --tree-filter 'git ls-files -z | xargs -0 dos2unix' -- --all
@nom3ad
nom3ad / gist:7f3c9716efdc26d66ace809792f60b26
Created June 5, 2022 06:56 — forked from romuald/gist:0346c76cfbbbceb3e4d1
Sub-millisecond profiling for python pstats
# -*- coding: utf8 -*-
"""
A simple monkeypath for the pstats module to be able to see sub-millisecond timings
If display value is 0.000, display the time in microseconds
"""
import pstats
def f8(x):
@nom3ad
nom3ad / rerender.directive.ts
Created May 15, 2022 17:35 — forked from anhkind/rerender.directive.ts
Angular directive to re-render a template if it detects any changes of the input
/**
* Example:
*
* <ng-container *rerender='changingInput'>
* this content will be re-rendered everytime `changingInput` changes
* </ng-container>
*/
import { Directive,
Input,
mkdir /tmp/www
cd /tmp/www; touch "$(hostname).txt"
sudo nohup python -m SimpleHTTPServer 80 > simplehttpserver.out &
#Start an HTTPS listener with some debug responses (I wonder if you can pipe to the HTTP server)
openssl req -x509 -newkey rsa:4096 -nodes -sha256 -keyout /tmp/key.pem -out /tmp/cert.pem -days 365 #Create self signed key. Only need this once and it will ask a few questions
sudo nohup openssl s_server -key /tmp/key.pem -cert /tmp/cert.pem -accept 443 -cipher kRSA+RSA -www > openssl.out &
@nom3ad
nom3ad / aws-iam-poilcy-schema.json
Created January 25, 2022 10:15 — forked from jstewmon/aws-iam-poilcy-schema.json
AWS IAM Policy JSON Schema
{
"type": "object",
"required": ["Statement"],
"additionalProperties": false,
"properties": {
"Version": {
"type": "string",
"enum": ["2008-10-17", "2012-10-17"]
},
"Id": {
@nom3ad
nom3ad / functions.sh
Created December 14, 2021 13:56 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
#!/usr/bin/env python
# https://github.com/jfsanchez91/pystun3/blob/py3-support/stun/__init__.py
import binascii
import logging
import random
import socket
import sys
@nom3ad
nom3ad / es6-class-to-es5-transpilation.md
Last active September 23, 2021 08:32
ts-playground
class A {
    public x;
    constructor(x: number) {
        this.x =x
    }
    Foo(){

    }
}