Can't run dmidecode on docker container
Docker provides an isolation layer, and one of the major goals of Docker is to hide details of the host's hardware from containers. The easiest, most appropriate way to query low-level details of the host's hardware is from a root shell on the host, ignoring Docker entirely.
The actual mechanism of this is by restricting Linux capabilities. capabilities(7) documents that you need CAP_SYS_RAWIO
to access /dev/mem
, so in principle you can launch your container with --cap-add SYS_RAWIO
. You might need other capabilities and/or device access to make this actually work, because Docker is hiding the details of what you're trying to access as a design goal.
Docker RUN apt-get install - Unable to locate package
Your Dockerfile
pulls ubuntu
which defaults to latest
tag, which is jammy-jellyfish/22.04
. guile-2.0-dev
doesn't exist in that version, it was upgraded to guile-2.2-dev
, so you'd want to do RUN apt-get update && apt-get install -y guile-2.2-dev
.
FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y bison guile-2.2-dev
If you specifically need guile-2.0-dev
, you will need FROM ubuntu:focal
(v20.04) or FROM ubuntu:bionic
(v18.04) depending on what Ubuntu you want.
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y bison guile-2.0-dev
Also see the ubuntu packages list: https://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=guile&searchon=names&release=all
Package guile-2.0-dev
bionic (18.04LTS) (lisp): Development files for Guile 2.0
2.0.13+1-5build2: amd64 arm64 armhf i386 ppc64el s390x
bionic-updates (lisp): Development files for Guile 2.0
2.0.13+1-5ubuntu0.1: amd64 arm64 armhf i386 ppc64el s390x
focal (20.04LTS) (lisp): Development files for Guile 2.0 [universe]
2.0.13+1-5.4: amd64 arm64 armhf i386 ppc64el s390x
Package guile-2.2-dev
bionic (18.04LTS) (lisp): Development files for Guile 2.2 [universe]
2.2.3+1-3build1: amd64 arm64 armhf i386 ppc64el s390x
bionic-updates (lisp): Development files for Guile 2.2 [universe]
2.2.3+1-3ubuntu0.1: amd64 arm64 armhf i386 ppc64el s390x
focal (20.04LTS) (lisp): Development files for Guile 2.2
2.2.7+1-4: amd64 arm64 armhf i386 ppc64el s390x
impish (21.10) (lisp): Development files for Guile 2.2
2.2.7+1-6build1: amd64 arm64 armhf i386 ppc64el s390x
jammy (22.04LTS) (lisp): Development files for Guile 2.2
2.2.7+1-6build2: amd64 arm64 armhf i386 ppc64el s390x
kinetic (lisp): Development files for Guile 2.2 [universe]
2.2.7+1-6build2: amd64 arm64 armhf ppc64el s390x
How to obtain the number of CPUs/cores in Linux from the command line?
grep -c ^processor /proc/cpuinfo
will count the number of lines starting with "processor" in /proc/cpuinfo
For systems with hyper-threading, you can use
grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}'
which should return (for example) 8
(whereas the command above would return 16
)
Related Topics
Timeouting a While Loop in Linux Shell Script
How to Export Daily Disk Usage to CSV Format in Shell Scripting
Which Tool Has Replaced Gatttool in Bluez5
Command and Script to Re-Read a File in Gnuplot
How to Get The Union of Two Arrays in Bash
Valueerror: Namespace Gtk Not Available
How to Change Vim's Default Mode
"The Launch Timed Out and Was Terminated" Error with Bumblebee on Linux
Error When Compiling Linux Kernel 3.2 for Arm
Grep,How to Search for Exact Pattern
.Rodata Section Loaded in Executable Page
(Mac) Leave Core File Where The Executable Is Instead of /Cores
Error While Using Make to Compile Glibc-2.11.1 for Linux from Scratch