Docker reverse generate Dockerfile files from container images? How to operate?
Docker reverse generate Dockerfile files from container images? How to operate?
you can use https://hub.docker.com/r/dduvnjak/dockerfile-from-image/
Note that this script applies only to images that exist in the local image repository (what you see when typing docker image
). If you want to generate Dockerfile, for an image that does not exist in the local repository, you first need docker pull.
for example, you can run the following sentence to see the code
$ docker run --rm -v /run/docker.sock:/run/docker.sock centurylink/dockerfile-from-image ruby
FROM buildpack-deps:latest
RUN useradd -g users user
RUN apt-get update && apt-get install -y bison procps
RUN apt-get update && apt-get install -y ruby
ADD dir:03090a5fdc5feb8b4f1d6a69214c37b5f6d653f5185cddb6bf7fd71e6ded561c in /usr/src/ruby
WORKDIR /usr/src/ruby
RUN chown -R user:users .
USER user
RUN autoconf && ./configure --disable-install-doc
RUN make -j"$(nproc)"
RUN make check
USER root
RUN apt-get purge -y ruby
RUN make install
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
RUN gem install bundler
ONBUILD ADD . /usr/src/app
ONBUILD WORKDIR /usr/src/app
ONBUILD RUN [ ! -e Gemfile ] || bundle install --system
the generated code is definitely different from the original Dockerfile, especially when it comes to file and directory mapping, you can only get some hashed directories / files, and the portability is completely lost. So it takes some manual editing work to use it.
give up the idea
what do you want?
I think what you need is to package the current container as an image instead of building it again with another image.
Docker history, but there is no way to restore it to dockerfile.
.so come up with the idea, and then try to find out how to build it.
Previous: Cron execution of python failed
Next: WeChat Mini Programs uses Baidu api to prompt No result available
in order to facilitate development, we plan to create a LNMP environment based on docker, which makes it much more convenient to change computers or unify the team s development environment. choreographed a docker-compose.yaml file with nginx, php-fp...
pulled the image of apache zeppelin and wanted the container to use the local ApacheDS for login management. the conf shiro.ini file of zeppelin needs to be configured at this time. I tried to enter the container to modify the configuration file, but...
I pull an image of hadoop, and I install jupyter, in it. I used to do data analysis, so I m used to using this tool. Now I want to learn about spark, in docker and plan to log on to jupyter on the host machine using a browser. But no matter how I specif...
my code is mapped through volumes. I changed the host time today and found that the changed code has no effect. I think it is not timely to update the mapping relationship, resulting in running the old code, changing the time correctly, and working norma...
docker exec-it-sharp container id bin sh after I enter -sharp how to press delete if I typed the wrong command? Deletion will directly change to ^ H symbol ...
the image of centos7 starting springboot always indicates that the port is occupied, but I m pretty sure that the port is not occupied, and the other port is still occupied which god knows what s going on ...
my docker for windows, runs on gitbash: docker D what should be done ...
recently I wanted to run laravel, with docker, so I searched docker hub and found this image . so I only share app and public according to the document given by him. There is no exception in external access, but I will report an error about missing p...
applications: image: tianon true nginx: build: context: . nginx args: - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER} - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT} volumes_from: - applications volumes: - ...
recently my docker container always closes automatically. then I open it with docker start < Container name >. I would like to ask if you still want "- what parameters "? this has never been the case before. ...
now I have a code for cloud disk service with port 8089. Now I want to instance two containers on one server, and then map container port 8089 to host 8080808081, but the cloud disk service in both containers is port 8089, and the port registered to eure...
the php project is deployed on docker. The master node returns the websocket server built by Swoole at port 10028 and listens on port 9502. The client failed to connect using IP plus port 9502. How to solve this problem ...
< H2 > description < H2 > normal if PHP, is installed on the system, if you want to run a php script directly, php a.php can see the result. how do I execute an a.php script if I use a docker build image? ...
Springboot application visits database. Error: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any enter the con...
I ve just read some introductory articles on docker, but I m still not sure whether it s appropriate to use docker to deploy a PHP project. For example, it is obviously inappropriate to package a project into a container as a virtual machine, and the ...
encountered this problem when using docker: my php project uses composer to install extensions. I want to update every time I run docker, and also run php start.php . This results in two commands composer update and php start.php in the cmd of th...
Today, I downloaded version 1.12.6 of docker, via yum using Ali CVM, and then downloaded a nginx image using docker. there is no problem at this time, but when you use docker run to create a nginx container, you will disconnect the Xshell remote conne...
Docker enters the jupyter all-spark-notebook container to change the password. Error: jovyan@67c686087c2d:~$ jupyter notebook password Enter password: Verify password: Traceback (most recent call last): File " opt conda bin jupyter-notebook&qu...
just get rid of the Chinese comments. How to solve the system environment windows10,? ...
refer to Docker Chinese official image acceleration with a domestic mirror source, but it has not worked. Using docker pull or visiting foreign warehouses > docker info ...... Server Version: 17.04.0-ce Kernel Version: 4.4.0-97-generic Operating S...