Changes

Jump to navigation Jump to search
23 bytes added ,  14:40, 25 March 2019
m
Line 60: Line 60:     
==Create & Publish image==
 
==Create & Publish image==
<source lang=bash>mkdir rpi_python</nowiki>
+
<source lang="bash">mkdir rpi_python
nano rpi_python/Dockerfile<nowiki></source>
+
nano rpi_python/Dockerfile</source>
    
Docekerfile
 
Docekerfile
 
  <nowiki># Pull base image
 
  <nowiki># Pull base image
  FROM resin/rpi-raspbian:wheezy
+
  FROM resin/rpi-raspbian:wheezy
  MAINTAINER Dieter Reuter <dieter@hypriot.com>
+
  MAINTAINER Dieter Reuter <dieter@hypriot.com>
 
+
 
  # Install dependencies
+
  # Install dependencies
  RUN apt-get update && apt-get install -y \
+
  RUN apt-get update && apt-get install -y \
      python \
+
      python \
      python-dev \
+
      python-dev \
      python-pip \
+
      python-pip \
      python-virtualenv \
+
      python-virtualenv \
      --no-install-recommends && \
+
      --no-install-recommends && \
      rm -rf /var/lib/apt/lists/*
+
      rm -rf /var/lib/apt/lists/*
 
+
 
  # Define working directory
+
  # Define working directory
  WORKDIR /data
+
  WORKDIR /data
 
+
 
  # Define default command
+
  # Define default command
  CMD ["bash"]</nowiki>
+
  CMD ["bash"]</nowiki>
    
  docker build -t DOCKER_HUB_USERNAME/rpi_python:0.0.1 .
 
  docker build -t DOCKER_HUB_USERNAME/rpi_python:0.0.1 .
Line 97: Line 97:     
  <nowiki>210
 
  <nowiki>210
  down vote
+
  down vote
  accepted
+
  accepted
 
+
 
 
+
 
  You need to commit the changes you make to the container and then run it. Try this:
+
  You need to commit the changes you make to the container and then run it. Try this:
 
+
 
  sudo docker pull ubuntu
+
  sudo docker pull ubuntu
 
+
 
  sudo docker run ubuntu apt-get install -y ping
+
  sudo docker run ubuntu apt-get install -y ping
 
+
 
  Then get the container id using this command:
+
  Then get the container id using this command:
 
+
 
  sudo docker ps -l
+
  sudo docker ps -l
 
+
 
  Commit changes to the container:
+
  Commit changes to the container:
 
+
 
  sudo docker commit <container_id> iman/ping  
+
  sudo docker commit <container_id> iman/ping  
 
+
 
  Then run the container:
+
  Then run the container:
 
+
 
  sudo docker run iman/ping ping www.google.com</nowiki>
+
  sudo docker run iman/ping ping www.google.com</nowiki>
    
==Docker mirror==
 
==Docker mirror==

Navigation menu