| Line 64: |
Line 64: |
| | | | |
| | Docekerfile | | Docekerfile |
| − | <source lang=text># Pull base image | + | <source lang="dockerfile"># 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"]</source>
| + | CMD ["bash"]</source> |
| | | | |
| | 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== |