i've been using a docker container to build the chromium browser (building for Android on Debian 10). I've already created a Dockerfile that contains most of the packages I need.
Now, after building and running the container, I followed the instructions, which asked me to execute an install script (./build/install-build-deps-android.sh). In this script multiple apt install commands are executed.
My question now is, is there a way to install these packages without rebuilding the container? Downloading and building it took rather long, plus rebuilding a container each time a new package is required seems kind of suboptimal. The error I get when executing the install script is:
./build/install-build-deps-android.sh: line 21: lsb_release: command not found
(I guess there will be multiple missing packages). And using apt will give:
root@677e294147dd:/android-build/chromium/src# apt install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nginx
(nginx just as an example install).
I'm thankfull for any hints, as I could only find guides that use the Dockerfile to install packages.
Overview. It is now possible to run Docker containers on Windows 10 and Windows Server, leveraging Ubuntu as a hosting base. Imagine running your own Linux applications on Windows, using a Linux distribution you are comfortable with: Ubuntu!
You can use docker commit:
sudo docker run IMAGE_NAME
sudo docker exec -it CONTAINER_ID bash
sudo docker commit CONTAINER_ID NEW_IMAGE_NAME
If you run now docker images
, you will see NEW_IMAGE_NAME
listed under your local images.
Next time, when starting the docker container, use the new docker image you just created:sudo docker run **NEW_IMAGE_NAME**
- this one will include your additional installations.
Answer based on the following tutorial: How to commit changes to docker image
Thanks for @adnanmuttaleb and @David Maze (unfortunately, they only replied, so I cannot accept their answers).
What I did was to edit the Dockerfile for any later updates (which already happened), and use the exec command to install the needed dependencies from outside the container. Also remember to
apt update
otherwise you cannot find anything...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With