Difference between revisions of "Containers and virtual machines"

From Wiki at Neela Nurseries
Jump to navigation Jump to search
m (→‎^ References: adding GNU Arm toolchain web site URL.)
m (Comment out older top-of-page links)
 
(96 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
+
<!--
 
<center>
 
<center>
[[Unix_and_Linux_config|Unix and Linux config]] :: [[Containers_and_virtual_machines|Containers]] :: [[Compute_clusters|Clusters]] :: &lt;link&gt;
+
[[Containers_and_virtual_machines|Containers]] :: [[RTOS|RTOS Notes]] :: [[Compute_clusters|Clusters]] :: [[Unix_and_Linux_config|Unix and Linux config]]
 
</center>
 
</center>
 
+
-->
  
 
== [[#top|^]] Container Software ==
 
== [[#top|^]] Container Software ==
Line 9: Line 9:
 
A promising starting point, collection of six articles / tutorials on Docker containers:
 
A promising starting point, collection of six articles / tutorials on Docker containers:
  
  *  https://medium.com/sysf/docker/home
+
(1) https://medium.com/sysf/docker/home
  
A general note following about three days' Docker container experimentation, and to question "should I be using a Docker container interactively, running multiple apps, some simultaneously?".  <i>(Note the following forum post chain is a quagmire of issues and opions!)</i>:
+
A general note following about three days' Docker container experimentation, and to question "should I be using a Docker container interactively, running multiple apps, some simultaneously?".  <i>(Note the following forum post chain is a quagmire of issues and opinions!)</i>:
  
  *  https://news.ycombinator.com/item?id=7950326
+
(2) https://news.ycombinator.com/item?id=7950326
  
=== [[#top|^]] Docker starting point ===
+
== [[#top|^]] Docker ==
  
 
Notes on Docker containerizing software.  Note, to get a practical start it is a good and or needed step to create a user account with Docker dot com.  Single user and free accounts with some advanced Docker features disabled are available.  A good starting tutorial for beginners is written by one Brian Hogan of Digital Ocean, this article published 2018 July 5.  First reference in list here:
 
Notes on Docker containerizing software.  Note, to get a practical start it is a good and or needed step to create a user account with Docker dot com.  Single user and free accounts with some advanced Docker features disabled are available.  A good starting tutorial for beginners is written by one Brian Hogan of Digital Ocean, this article published 2018 July 5.  First reference in list here:
 +
 
<ul>
 
<ul>
 
*  [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 Docker on Ubuntu 18.04 LTS]
 
*  [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 Docker on Ubuntu 18.04 LTS]
 
*  [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04 Docker on Ubuntu 20.04 LTS]
 
*  [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04 Docker on Ubuntu 20.04 LTS]
 
*  https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes  Remove Docker image
 
*  https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes  Remove Docker image
 +
2023-06-07:
 +
*  [https://collabnix.com/how-to-fix-cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-error-message/ Docker cannot connect, blog by Ajeet Raina]
 
</ul>
 
</ul>
Ted noting too there may be a daily limit to the number of docker images which a user with a free account can push to Docker's image repository.  Docker's image repository provides URLs of the form <code>https://hub.docker.com/u/&lt;user_name&gt;</code>, where username is the given person's Docker account user name.
 
  
 
+
<center>
=== [[#top|^]] specific commands ===
+
- - - [[#top|top of page]] - - -
 
+
</center>
Start a docker image with access to a particular host directory:
 
 
 
*  https://stackoverflow.com/questions/55104551/how-to-access-files-in-host-from-a-docker-container
 
<ul>
 
More on Docker volumes:
 
*  https://docs.docker.com/storage/volumes/
 
</ul>
 
 
 
==== [[#top|^]] docker commit ... ====
 
 
 
<pre>
 
 
 
</pre>
 
 
 
 
 
==== [[#top|^]] docker push &lt;image_identifier_string_and_optional_tag&gt; ====
 
 
 
Series of <code>docker push</code> invocations for a work-in-progress image.  Note the tag names are optional until one needs push an image that's being amended, such that it is a newer or different version of an existing image on the remote Docker repository:
 
 
 
<pre>
 
  886  docker push tedhavelkaad0602/ubuntu-git-plus-arm-none-eabi-gcc
 
  932  docker push tedhavelkaad0602/ubuntu-git-plus-arm-none-eabi-gcc:version-0p2
 
  944  docker push tedhavelkaad0602/ubuntu-git-plus-arm-none-eabi-gcc:version-0p3
 
  962  docker push tedhavelkaad0602/ubuntu-git-plus-arm-none-eabi-gcc:version-0p4
 
  965  docker push tedhavelkaad0602/ubuntu-git-plus-arm-none-eabi-gcc:version-0p5
 
</pre>
 
 
 
<!-- comment -->
 
 
 
Delete a Docker repository on Docker hub:
 
 
 
*  https://hub.docker.com/support/doc/how-do-i-delete-a-repository
 
 
 
==== [[#top|^]] docker container rm [...], docker image rm [...] ====
 
Delete (remove) a local Docker image . . . first must remove all local containers which use given image:
 
*  https://docs.docker.com/engine/reference/commandline/container_rm/
 
*  https://docs.docker.com/engine/reference/commandline/image_rm/
 
Commands which worked locally:
 
<pre>
 
1036  docker ps -a
 
1037  docker container rm bdc45e3021ad
 
1038  docker ps -a
 
1039  docker container rm 3899ce3b4c5f 85206c6c2565
 
1040  docker ps -a
 
1041  docker container rm e530246d9393 775ef655da0f 51a5967aecf8
 
1042  docker ps -a
 
  .
 
  .
 
  .
 
1047  docker image rm tedhavelkaad0602/ubuntu-04-vim--openssh-server--man-db
 
1048  docker images
 
1049  docker image rm tedhavelkaad0602/ubuntu-nodejs-net-tools
 
1050  docker images
 
</pre>
 
 
 
 
 
Secure shell into, or otherwise connect with a running Docker container in and of a Linux environment:
 
*  https://stackoverflow.com/questions/30172605/how-do-i-get-into-a-docker-containers-shell
 
 
 
*  https://docs.docker.com/samples/running_ssh_service/
 
 
 
*  https://github.com/linuxserver/docker-openssh-server
 
*  https://github.com/linuxserver/docker-openssh-server/blob/71d16e9d09cf8b319ccec9bde2e64ed9298a6d95/LICENSE
 
 
 
A couple examples of running second <code>bash</code> instance of a given Docker container, not a login, but provides second interactive window or interface to a given Docker container:
 
 
 
==== [[#top|^]] docker exec [options] [command_in_container] ====
 
<pre>
 
  937  docker exec -t -i a42e2e801d60 bash
 
  938  docker exec -i -t 51a5967aecf8 bash
 
</pre>
 
 
 
Note this can have unintended consequences given that there's no ssh server running to handle multiple, or additional logins!
 
<!-- comment -->
 
 
 
-- Enable USB access in Docker container --
 
 
 
*  https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device
 
 
 
<!-- comment -->
 
 
 
=== [[#top|^]] Docker volumes ===
 
 
 
https://www.digitalocean.com/community/tutorials/how-to-share-data-between-docker-containers
 
 
 
<!-- comment -->
 
 
 
=== [[#top|^]] Anatomy of a Dockerfile ===
 
Ok Ted needs to figure out what are Dockerfiles and how should they be authored and maintained.  One example that's annotated:
 
*  https://gist.github.com/adamveld12/4815792fadf119ef41bd
 
A link to a Docker based project which comes very close to what we're working on for an embedded development toolchain and environment that's fully tracked, easy to reproduce on demand:
 
*  https://dev.to/dalimay28/using-docker-for-embedded-systems-development-b16
 
 
 
<!-- comment -->
 
 
 
=== [[#top|^]] Promising Docker images ===
 
 
 
*  https://hub.docker.com/r/rastasheep/ubuntu-sshd
 
 
 
=== [[#top|^]] to access physical devices within container ===
 
 
 
*  https://forums.unraid.net/topic/47595-how-do-i-pass-through-a-usb-device-to-a-docker-container/
 
 
 
<!-- comment -->
 
<!-- *************************************************************** -->
 
<!-- *************************************************************** -->
 
<!-- *************************************************************** -->
 
 
 
== [[#top|^]] Kubernetes Container Software ==
 
 
 
Kubernetes notes <i>2021-06-09 This section a stub section.</i>
 
<ul>
 
*  https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/
 
</ul>
 
 
 
<!-- comment -->
 
 
 
== [[#top|^]] Oracle Corporation VirtualBox software ==
 
 
 
VirtualBox on-line manual
 
<ul>
 
*  https://www.virtualbox.org/manual/ch01.html#virt-why-useful
 
Some important VM terms include,
 
<ul>
 
*  host OS  . . . the OS on which VirtualBox software runs
 
*  guest OS  . . . the OS which runs inside a VirtualBox VM instance
 
*  virtual machine  . . . the hosting environment which VirtualBox creates for given guest OS
 
</ul>
 
 
 
To set up shared folders in VirtualBox instances, see VirtualBox documentation chapter 4 at the first following URL.  There are also some needed steps detailed in same Oracle documentation, chapter 2, second URL here:
 
*  https://www.virtualbox.org/manual/ch04.html
 
*  https://www.virtualbox.org/manual/ch02.html#externalkernelmodules
 
 
 
Following screen capture is from Ted's work setting up virtual Ubuntu host.
 
 
 
<i>Figure 1 - capture of VM Ubuntu guest OS command prompt, with steps to mount VirtualBox CDROM drive:</i>
 
 
 
<!-- [[File:executing-VBoxLinuxAdditions-dot-run.PNG]] -->
 
[[Image:executing-VBoxLinuxAdditions-dot-run.PNG|700px]]
 
 
 
Interestingly, mounting the device /dev/sr0 within the guest OS provides access to several files which we did not see or explicitly install when installing VirtualBox framework software.  Scripts to set up needed Linux kernel modules are among these files at <code>/media/cdrom</code>.
 
 
 
To configure port forwarding, for ssh from host OS to guest OS:
 
*  https://nsrc.org/workshops/2014/btnog/raw-attachment/wiki/Track2Agenda/ex-virtualbox-portforward-ssh.htm
 
 
 
Where VirtualBox stores its files . . .
 
*  https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/vboxconfigdata.html
 
 
 
<!-- comment -->
 
 
 
== [[#top|^]] References ==
 
 
 
*  https://www.virtualbox.org/wiki/Downloads
 
 
 
For Ubuntu installs be sure to make /boot large enough, e.g. ~500MB when creating a separate /boot partition:
 
*  https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1876562
 
 
 
=== Git client config in VM and Docker container ===
 
 
 
For firmware dev work whether in virtual machines and or Docker containers, we need access to remote git repositories.  SSL keys are necessary for this access.  Here are some beginning notes to explain setting up such keys within each environment:
 
 
 
<pre>
 
  337  ssh-keygen -t ed25519  <-- generate elliptic type key
 
  338  cd .ssh
 
  340  ls -l
 
  341  cat id_ed25519.pub      <-- dump public key to terminal to copy
 
  342  which ssh-agent        <-- check that `ssh-agent` is installed and in local $PATH variable
 
  346  ps ax | grep ssh-agent  <-- check whether ssh-agent is presently running
 
  348  eval `ssh-agent -s`    <-- start ssh-agent running when not found running
 
  349  ps ax | grep ssh-agent  <-- confirm running in background as a daemon
 
  350  ssh-add ./id_ed25519    <-- add the private key of the public + private key pair created above
 
</pre>
 
 
 
GNU Arm Toolchain refs:
 
*  https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm
 
<!-- comment -->
 

Latest revision as of 14:50, 26 January 2026


^ Container Software

A promising starting point, collection of six articles / tutorials on Docker containers:

(1) https://medium.com/sysf/docker/home

A general note following about three days' Docker container experimentation, and to question "should I be using a Docker container interactively, running multiple apps, some simultaneously?". (Note the following forum post chain is a quagmire of issues and opinions!):

(2) https://news.ycombinator.com/item?id=7950326

^ Docker

Notes on Docker containerizing software. Note, to get a practical start it is a good and or needed step to create a user account with Docker dot com. Single user and free accounts with some advanced Docker features disabled are available. A good starting tutorial for beginners is written by one Brian Hogan of Digital Ocean, this article published 2018 July 5. First reference in list here:

- - - top of page - - -