moul / random-ideas

:bulb: random ideas
github.com/moul
0 stars 0 forks source link

MRFC 3 - Cross-platform Dockerfiles #3

Open moul opened 9 years ago

moul commented 9 years ago

A way to define cross-platform dockerfiles

# Per-platform FROM command
FROM ubuntu             # PLAT=amd64
FROM armbuild/ubuntu    # PLAT=armhf

# Multi-platform RUN command
RUN apt-get install nginx

# Per-platform RUN command
RUN wget https://github.com/moul/ssh2docker/releases/download/v1.1.0/ssh2docker_1.1.0_linux_386 -O ssh2docker    # PLAT=amd64
RUN wget https://github.com/moul/ssh2docker/releases/download/v1.1.0/ssh2docker_1.1.0_linux_arm -O ssh2docker    # PLAT=armhf

# Multi-platform RUN command
RUN chmod +x ssh2docker
moul commented 8 years ago

POC here: https://github.com/multiarch/dockerfile