Skip to content

Instantly share code, notes, and snippets.

Last active October 12, 2019 04:58
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rsaddey/1b8df62de457a1cf00da45a6df5071c4 to your computer and use it in GitHub Desktop.
A Dockerfile for creating a Ionic 2 image to be used for creating Progressive Web Apps without permanently infecting your computer.
# No thrills Ionic 2 developer environment
# See
FROM ubuntu:16.04
MAINTAINER Reiner Saddey <>
LABEL Description="Interactive Ionic 2 Framework example using volume /projects as the root for your app directories"
RUN apt-get update
RUN apt-get install -y -q \
# As of 03-jul-16: Ionic is not yet ready for Node.js 6, see
# RUN curl -sL | bash -
RUN curl -sL | bash -
# nodejs includes matching npm as well
RUN apt-get install -y -q \
nodejs \
&& apt-get -y autoclean \
&& rm -rf /var/lib/apt/lists/*
# As of 03-jul-16: You have been warned, DO NOT push this button: RUN npm update -g npm
# Reinstalling npm v3 fails on Docker
RUN npm install -g -y ionic@beta
RUN echo '1. Run ineractively and map the /projects volume to your host, e.g. docker run -it -v /Users/<host_path>:/projects <image>' > /readme.txt
RUN echo '2. ionic start myFirstIonic2App sidemenu --v2 --ts ### --ts selects TypeScript' >> /readme.txt
RUN echo '3. cd myFirstIonic2App' >> /readme.txt
RUN echo '4. ionic serve --all' >> /readme.txt
RUN echo 'cd /projects' > /
RUN echo 'cat /readme.txt' >> /
WORKDIR /projects
CMD bash -C '/';'bash'
EXPOSE 8100 35729
# 20-aug-16: Do NOT use VOLUME statement as it may result in numerous
# orphaned volumes when innocent users or apps just run
# docker run --rm ... bash
# VOLUME /projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment