Docker container is useful when building the data analysis environment with fixed version of software (e.g. ubuntu, jupyterlab, or anaconda).
Dockefile 1 2 3 4 5 6 FROM ubuntu:latest RUN apt-get update && apt-get install -y \ sudo wget \ vim WORKDIR /opt RUN wget https://repo.anaconda.com/archive/Anaconda3-2023.07-2-Linux-x86_64.sh Build image As my environment is M1 Mac (Apple Silicon), I needed to add --platform linux/amd64 option.
1 docker build --platform linux/amd64 .
Docker Run options -v : Share a file system Mount host directory
1 docker run -v <host directory path>:<container directory path> Dockerfile:
1 2 FROM ubuntu:latest RUN mkdir new_dir 1 docker run -it -v ~/Desktop/monted_folder:/new_dir <container> bash If new_dir directory does not exist in the container, docker automatically create it.
-u : Set access privilege to the files 1 docker run -u <user id>:<group id> At host, check user and group id.
Dockerfile Dockerfile:
1 2 FROM ubuntu:latest RUN touch test Dockerfile is good to maintenance the build image (rather than docker commit by a container)
Build docker Build docker: on the directory for the project (with Dockerfile),
1 docker build . 1 2 3 4 5 6 7 8 9 10 11 12 % docker build . [+] Building 0.7s (6/6) FINISHED => [internal] load build definition from Dockerfile 0.
Environment 1 2 3 4 5 6 7 8 9 10 11 12 $ uname -a Linux rpi4 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye $ julius --version JuliusLib rev.4.6 (fast) Prioritize USB microphone Check sound device
1 2 3 4 5 $ cat /proc/asound/modules 0 snd_bcm2835 1 vc4 2 snd_usb_audio 3 vc4 Prioritize USB Mic
Environment 1 2 3 4 5 6 7 8 9 $ uname -a Linux rpi4 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye Installation Install dependencies.
1 sudo apt-get install build-essential zlib1g-dev libsdl2-dev libasound2-dev In your any directory on Raspberry pi, make a directory (in my case, julius-speech)
I needed to test the recording quality of USB microphones for attaching it to the voice recognition system.
Product spec
# (in picture): Maker Product Product Spec Price 1: 共立 MI-305 USBマイク Sensitivity:-67 dBV/pBar,-47dBV/Pascal +/-4dB, Microphone frequency range:100-16kHz 500-1000JPY 2: BUFFALO BSWHD06M (No description about microphone) ~1800JPY 3: Logitech B910 HD Webcam (No description about microphone) ~8000JPY 4: Jabra Jabra Speak 510 UC Microphone frequency range: 150-6.