Closed ChrisYH20 closed 8 months ago
You shouldn't have problems by simply building the image with the Dockerfile on ARM.
Sorry, I am not particularly familiar with some operations of docker. Is it to build an image of amd64 architecture into an image of arm64 architecture through dockerfile?
There shouldn't be any Docker Image on Docker Hub actually. So you always need to build it manually. This should work on ARM64 too.
The Dockefile uses this Image: https://hub.docker.com/_/python
That's also available on amr64. See at "Supported Architectures".
Try this:
git clone https://github.com/lossless1024/StreaMonitor.git
cd ./StreaMonitor/
docker build -t streamonitor:latest .
You should now have an Image streamonitor with tag latest available for usage.
Optionally you can change the FROM tag to bookworm.
cp Dockerfile Dockerfile.arm
Siwtch tag and build like this:
docker build -f Dockerfile.arm -t streamonitor:latest .
Note that tags can only exist unique.
That's it.
Thank you for your patient answer, but there is a small problem that prevents the container from starting. As follows:
root@Arthur:/mnt/mmcblk0p24/Docker/StreaMonitor/StreaMonitor# docker run --restart=always -v /mnt/mmcblk0p24/Download/Video/StreaMonitor:/app/downloads -v /mnt/mmcblk0p24/Docker/StreaMonitor/config:/app/config.json -v /mnt/mmcblk0p24/Docker/StreaMonitor/parameters:/app -p 6969:6969 streamonitor:v2
python3: can't open file '/app/Downloader.py': [Errno 2] No such file or directory
This is the code when building:
Step 9/9: CMD [ "python3", "Downloader.py"]
---> Running in b1188abf6a47
Removing intermediate container b1188abf6a47
---> fdeee1eb1cb9
Successfully built fdeee1eb1cb9
Successfully tagged streamonitor:v2
But if you use docker-compose up, there will be no problem
Yes because your mounts are wrong. I'm assuming the following:
Image Name: streamonitor:v2 Your base dir: /mnt/mmcblk0p24/Docker/StreaMonitor/
Do this:
mkdir /mnt/mmcblk0p24/Docker/StreaMonitor/downloads/
mkdir /mnt/mmcblk0p24/Docker/StreaMonitor/configs/
touch /mnt/mmcblk0p24/Docker/StreaMonitor/configs/config.json
cp /path/to/your/streamonitor-git/parameters.py /mnt/mmcblk0p24/Docker/StreaMonitor/configs/parameters.py
cd /mnt/mmcblk0p24/Docker/StreaMonitor/
Your docker-compose.yml would look now like this:
version: "3.7"
services:
streamonitor:
image: streamonitor:v2
volumes:
- ./downloads:/app/downloads
- ./configs/config.json:/app/config.json
- ./configs/parameters.py:/app/parameters.py
ports:
- '6969:6969'
Place this file in /mnt/mmcblk0p24/Docker/StreaMonitor/docker-compose.yml
Your docker command would look like this:
docker run --restart=always -v /mnt/mmcblk0p24/Docker/StreaMonitor/downloads/:/app/downloads -v /mnt/mmcblk0p24/Docker/StreaMonitor/configs/config.json:/app/config.json -v /mnt/mmcblk0p24/Docker/StreaMonitor/configs/parameters.py:/app/parameters.py -p 6969:6969 streamonitor:v2
Your command mounts away /app dir which is the base dir so nothing can be found.
Already solved, thank you
There are only linux/amd64 versions of docker images in docker hub. Has the author considered adapting to linux/arm64?