Git Product home page Git Product logo

Comments (7)

koenvervloesem avatar koenvervloesem commented on August 20, 2024

You have to mount an image file, not a directory. For instance:

docker run -it -v ~/project/2019-09-26-raspbian-buster-lite.img:/sdcard/filesystem.img lukechilds/dockerpi:vm

from dockerpi.

xieydd avatar xieydd commented on August 20, 2024

@koenvervloesem Tnanks for your reply, i still have three question:

  1. I notice in README.md You can persist filesystem changes between reboots by mounting the /sdcard volume on your host: docker run -it -v $HOME/.dockerpi:/sdcard lukechilds/dockerpi
  2. how can i pack my file in img file?
  3. And why i can`t connect the internet.

from dockerpi.

koenvervloesem avatar koenvervloesem commented on August 20, 2024
  1. and 2. You have to create your own bootable image file, e.g. with pi-gen to create your own custom Raspbian derivative. I can confirm that the result boots with dockerpi.
  2. Your virtualized system has a virtual network that isn't connected to your real network by default. Have a look at Docker and qemu networking if you want to have an internet connection in your virtualized system. I haven't done this myself yet because I don't need it for my use case.

from dockerpi.

lukechilds avatar lukechilds commented on August 20, 2024

Thanks for helping out here @koenvervloesem!

Btw, re:

  1. And why i can`t connect the internet.

You should be able to connect to the internet. Docker/QEMU networking should be working OOB.

Example:


Raspbian GNU/Linux 10 raspberrypi ttyAMA0

raspberrypi login: pi
Password:
Linux raspberrypi 4.19.50+ #1 Tue Nov 26 01:49:16 CET 2019 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

pi@raspberrypi:~$ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian buster InRelease [25.1 kB]
Get:3 http://archive.raspberrypi.org/debian buster/main armhf Packages [278 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Fetched 13.3 MB in 50s (269 kB/s)
Reading package lists... Done
pi@raspberrypi:~$ sudo apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libcurl4
The following packages will be upgraded:
  curl libcurl4
2 upgraded, 0 newly installed, 0 to remove and 77 not upgraded.
Need to get 548 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://mirror1.ku.ac.th/raspbian/raspbian buster/main armhf curl armhf 7.64.0-4+deb10u1 [254 kB]
Get:2 http://mirror1.ku.ac.th/raspbian/raspbian buster/main armhf libcurl4 armhf 7.64.0-4+deb10u1 [294 kB]
Fetched 548 kB in 11s (51.5 kB/s)
Reading changelogs... Done
(Reading database ... 39798 files and directories currently installed.)
Preparing to unpack .../curl_7.64.0-4+deb10u1_armhf.deb ...
Unpacking curl (7.64.0-4+deb10u1) over (7.64.0-4) ...
Preparing to unpack .../libcurl4_7.64.0-4+deb10u1_armhf.deb ...
Unpacking libcurl4:armhf (7.64.0-4+deb10u1) over (7.64.0-4) ...
Setting up libcurl4:armhf (7.64.0-4+deb10u1) ...
Setting up curl (7.64.0-4+deb10u1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
pi@raspberrypi:~$ curl example.com
<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
    body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

    }
    div {
        width: 600px;
        margin: 5em auto;
        padding: 2em;
        background-color: #fdfdff;
        border-radius: 0.5em;
        box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
    }
    a:link, a:visited {
        color: #38488f;
        text-decoration: none;
    }
    @media (max-width: 700px) {
        div {
            margin: 0 auto;
            width: auto;
        }
    }
    </style>
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is for use in illustrative examples in documents. You may use this
    domain in literature without prior coordination or asking for permission.</p>
    <p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>

from dockerpi.

xieydd avatar xieydd commented on August 20, 2024

@lukechilds I have connect to the internet successful, and i also build a armv7 version, i notice this repo is only armv6 version.

from dockerpi.

lukechilds avatar lukechilds commented on August 20, 2024

There is currently a PR open for Pi 2/3 hardware: #4

from dockerpi.

saiworksandbox avatar saiworksandbox commented on August 20, 2024

As a sidenote: If you do not have internet access (on the pi container), you can fix it by editing the /etc/resolv.conf file in the pi container to reflect the same as the host (tested on Ubuntu WSL)

from dockerpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.