Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
510 views
in Technique[技术] by (71.8m points)

Can't create docker image for raspberry pi with angular app

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...