A few months ago I had my Angular test sample application running on my Raspberry pi on docker container.
The angular for testing purposes is simply a newly created Angular app, without any customization.
ng new exampleHelloDocker
For the Dockerfile I used the following three lines. Here it was important that I used the image for ARM system.
FROM arm32v7/alpine
COPY /dist/ExampleHelloDocker /usr/share/nginx/html
EXPOSE 80
Before I created the Docker image, the Angular app was built.
ng build --prod
I was then able to create the Docker image.
docker build -t example-hello-docker .
I'll spare the description of how to upload this to Docker Hub at this point.
Up to here, this had worked and if I set this for the Windows system, the image also goes.
I have already searched for another solution, unfortunately, the others have also left this question unanswered. Unfortunately, I only know the basics of Docker.
Maybe the solution is simple, but so long I continue to read the documentation.
Currently I use:
- Windows 10 Build 19042
- Angular 9.0.7
- Docker Desktop 3.0.0 (Docker Engine 20.10.0)
- Raspbian (Raspbian GNU/Linux 10)
What has changed?
The Docker Desktop version is more recent. Since then, building a Docker image with Angular App takes significantly longer. This could be narrowed down to the virus scanner, because when that is turned off, it runs at the usual speed.
Another noticeable thing is that the Docker image is smaller (less than 3MB).
What have I missed?
question from:
https://stackoverflow.com/questions/65851902/cant-create-docker-image-for-raspberry-pi-with-angular-app 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…