Skip to content

Instantly share code, notes, and snippets.

@04n0
Last active March 12, 2018 20:15
Show Gist options
  • Save 04n0/fc062055b8a9522edc464dd55845a2e2 to your computer and use it in GitHub Desktop.
Save 04n0/fc062055b8a9522edc464dd55845a2e2 to your computer and use it in GitHub Desktop.
unsorted stuff and comments

There are many types of Dockerfile practices

common dude

RUN apt-get update && \
    apt-get install -y nodejs npm && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

common dude v2

RUN \
    apt-get update && \
    apt-get install -y nodejs npm && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

indent fetishist

RUN    apt-get update \
    && apt-get install -y nodejs npm \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

2014 guy

RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y nodejs npm

oneliner

RUN apt-get update && apt-get upgrade -y && apt-get install -y nodejs npm && apt-get clean

variabler

ARG PACKAGES="nodejs npm"
RUN apt-get update && \
    apt-get install -y ${PACKAGES} && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment