1. The demand
There is an old project that needs to use Sencha Touch, using sencha CMD version 4.0. With the MAC system upgrade, Java has been installed as 8.0, causing the old version of CMD to not run properly. But I can’t downgrade my system either.
2. Solutions
Which brings us to Docker.
Third-party resources
Github.com/rockmagic/s…
Someone has already made the image and you just need to get it.
docker
In fact, Docker is very simple and IT is my first time to use it.
My understanding is that a lightweight virtual machine with installation configuration can create a large number of containers because of the layered design. The image is the template, and the container is the instance.
Even though the image is the same, the container is different because the parameters are different.
Of course, there are more advanced Docker gameplay, such as management and monitoring. Anyway, I’m not operations, I can’t use it, I don’t have a chance to try it, AND I don’t learn.
A lot of technology is like eyeglasses, you know how to use them when you need them.
3. The operating
- Install Docker and download DMG from the official website
- Command line to obtain the image
Reference github.com/rockmagic/s… In the command
docker run --rm -v `pwd`:/app -w /app rockmagicnet/sencha-cmd:latest
app build
Copy the code
Execute the command for the first installation
Docker run - name xx_build - v/Users/xxxName/code/xxProject: / app - w/app/rockmagicnet sencha - CMD: 4.0.5 app build package# --name give me a name
-v Suspend data
# app build package sencha
Copy the code
Docker downloads the image when it’s first executed, and creates containers that can be reused later, with less complex configuration
Use at ordinary times
docker start xx_build -i
# xx_build is the initial name
Copy the code
Looking at existing containers in Docker, I only use packaging and refresh, so there are only two containers
4. Backup
Since Sench might accidentally remove the zip package’s download address, the entire image is backed up and saved to hard disk so that it can’t be packaged. That was clever of me.
Reference documentation
www.hangge.com/blog/cache/…
Docker Export Docker Save image
I saved the image and generated the container itself