2021年3月3日星期三

How to build ionic / angular app using docker

I have an ionic / angular / cordova application, and I'm trying to use Docker to create an apk. The docker file is in a sub-sub folder (because I intend to have several docker files for various un-related tasks). How can I get the docker to use the ionic code that is 2 directories up?

Here is my project structure (I'm on MacOS). "/path/to/" is actually something like /Users/[my name]/Documents/ionic-project/

/path/to/e2e  /path/to/gen  /path/to/google_services  /path/to/node_modules  /path/to/out  /path/to/platforms  /path/to/plugins  /path/to/resources  /path/to/scripts  /path/to/src (contains my angular code)  /path/to/typings  /path/to/config.xml  /path/to/ionic.config.json  .... several other individual ionic-related files  

then, I also have:

/path/to/docker  

and within this "docker" folder, I have sub-folders for each Dockerfile, e.g.:

/path/to/docker/android/Dockerfile  /path/to/docker/ios/Dockerfile  /path/to/docker/othertask/Dockerfile  etc..  

My docker file contains all the required tool installations for Android (Gradle, JRE, Android tools, etc.) and all that seems to be working.

At the end of the docker file, I have:

WORKDIR  RUN npm install  

I suspect that I need to change WORKDIR and maybe do a COPY command to get the source files somehow (or, maybe pull from Git repo?), but nothing that I've attempted works.

In essence, I am hoping to run a single docker command that builds an APK files with the existing ionic files that exist a couple of directories "up" from it.

https://stackoverflow.com/questions/66460914/how-to-build-ionic-angular-app-using-docker March 04, 2021 at 12:17AM

没有评论:

发表评论