Docker: is it possible to get the full command line that launched a docker container from the host? If yes, how?See full command of running/stopped container in DockerHow is Docker different from a virtual machine?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersExposing a port on a live Docker containerCopying files from Docker container to hostCopying files from host to Docker containerHow to mount a host directory in a Docker containerHow to copy Docker images from one host to another without using a repositoryFrom inside of a Docker container, how do I connect to the localhost of the machine?

Does having a TSA Pre-Check member in your flight reservation increase the chances that everyone gets Pre-Check?

A social experiment. What is the worst that can happen?

Is it improper etiquette to ask your opponent what his/her rating is before the game?

Why did the EU agree to delay the Brexit deadline?

On a tidally locked planet, would time be quantized?

What does this horizontal bar at the first measure mean?

Is XSS in canonical link possible?

Can I use my Chinese passport to enter China after I acquired another citizenship?

Varistor? Purpose and principle

My friend sent me a screenshot of a transaction hash, but when I search for it I find divergent data. What happened?

Query about absorption line spectra

Drawing ramified coverings with tikz

Is camera lens focus an exact point or a range?

Proving a function is onto where f(x)=|x|.

Melting point of aspirin, contradicting sources

In Star Trek IV, why did the Bounty go back to a time when whales were already rare?

Difference between -| and |- in TikZ

Can I Retrieve Email Addresses from BCC?

How do ground effect vehicles perform turns?

Did arcade monitors have same pixel aspect ratio as TV sets?

When quoting, must I also copy hyphens used to divide words that continue on the next line?

Why do IPv6 unique local addresses have to have a /48 prefix?

Diode in opposite direction?

Greco-Roman egalitarianism



Docker: is it possible to get the full command line that launched a docker container from the host? If yes, how?


See full command of running/stopped container in DockerHow is Docker different from a virtual machine?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersExposing a port on a live Docker containerCopying files from Docker container to hostCopying files from host to Docker containerHow to mount a host directory in a Docker containerHow to copy Docker images from one host to another without using a repositoryFrom inside of a Docker container, how do I connect to the localhost of the machine?













0















I am not asking this question: See full command of running/stopped container in Docker



What I am asking is, if someone runs a docker container from the host with a command such as:



docker run --lots --of --mysterious --parameters --volumes --etc image-name


Is there some way for someone else to obtain the original command line in the host system that was used to create the container?



My guess is that no, that you would have to reconstruct it manually by putting together all information obtained from docker inspect... but I may be wrong.



Edit



It seems there is no way to get this information from docker itself, but as explained in the comments below, you can always type history | grep "docker run" and search for the one that launched the container.










share|improve this question



















  • 1





    The Linux history command gives info on the last executed command so if you are using a common user to execute that command should be visible in history or in the .bash_history profile

    – error404
    Mar 7 at 9:24












  • you might be able to see the full command in ps -ef | grep 'docker'

    – scipsycho
    Mar 7 at 9:31






  • 1





    @yashbagarka I did not think about this cool workaround. I typed history | grep "docker run" and there it was :-). Thank you!

    – Luis Crespo
    Mar 7 at 10:17












  • @scipsycho I tried the ps -ef | grep "docker" and found that the docker command-line tool launches other processes and then dies. So what I see in the ps output is not the original docker command, but something else with very different parameters.

    – Luis Crespo
    Mar 7 at 10:20











  • @LuisCrespo update the question with answer. Pls accept it

    – error404
    Mar 7 at 10:46















0















I am not asking this question: See full command of running/stopped container in Docker



What I am asking is, if someone runs a docker container from the host with a command such as:



docker run --lots --of --mysterious --parameters --volumes --etc image-name


Is there some way for someone else to obtain the original command line in the host system that was used to create the container?



My guess is that no, that you would have to reconstruct it manually by putting together all information obtained from docker inspect... but I may be wrong.



Edit



It seems there is no way to get this information from docker itself, but as explained in the comments below, you can always type history | grep "docker run" and search for the one that launched the container.










share|improve this question



















  • 1





    The Linux history command gives info on the last executed command so if you are using a common user to execute that command should be visible in history or in the .bash_history profile

    – error404
    Mar 7 at 9:24












  • you might be able to see the full command in ps -ef | grep 'docker'

    – scipsycho
    Mar 7 at 9:31






  • 1





    @yashbagarka I did not think about this cool workaround. I typed history | grep "docker run" and there it was :-). Thank you!

    – Luis Crespo
    Mar 7 at 10:17












  • @scipsycho I tried the ps -ef | grep "docker" and found that the docker command-line tool launches other processes and then dies. So what I see in the ps output is not the original docker command, but something else with very different parameters.

    – Luis Crespo
    Mar 7 at 10:20











  • @LuisCrespo update the question with answer. Pls accept it

    – error404
    Mar 7 at 10:46













0












0








0








I am not asking this question: See full command of running/stopped container in Docker



What I am asking is, if someone runs a docker container from the host with a command such as:



docker run --lots --of --mysterious --parameters --volumes --etc image-name


Is there some way for someone else to obtain the original command line in the host system that was used to create the container?



My guess is that no, that you would have to reconstruct it manually by putting together all information obtained from docker inspect... but I may be wrong.



Edit



It seems there is no way to get this information from docker itself, but as explained in the comments below, you can always type history | grep "docker run" and search for the one that launched the container.










share|improve this question
















I am not asking this question: See full command of running/stopped container in Docker



What I am asking is, if someone runs a docker container from the host with a command such as:



docker run --lots --of --mysterious --parameters --volumes --etc image-name


Is there some way for someone else to obtain the original command line in the host system that was used to create the container?



My guess is that no, that you would have to reconstruct it manually by putting together all information obtained from docker inspect... but I may be wrong.



Edit



It seems there is no way to get this information from docker itself, but as explained in the comments below, you can always type history | grep "docker run" and search for the one that launched the container.







docker






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 11:13







Luis Crespo

















asked Mar 7 at 9:20









Luis CrespoLuis Crespo

379315




379315







  • 1





    The Linux history command gives info on the last executed command so if you are using a common user to execute that command should be visible in history or in the .bash_history profile

    – error404
    Mar 7 at 9:24












  • you might be able to see the full command in ps -ef | grep 'docker'

    – scipsycho
    Mar 7 at 9:31






  • 1





    @yashbagarka I did not think about this cool workaround. I typed history | grep "docker run" and there it was :-). Thank you!

    – Luis Crespo
    Mar 7 at 10:17












  • @scipsycho I tried the ps -ef | grep "docker" and found that the docker command-line tool launches other processes and then dies. So what I see in the ps output is not the original docker command, but something else with very different parameters.

    – Luis Crespo
    Mar 7 at 10:20











  • @LuisCrespo update the question with answer. Pls accept it

    – error404
    Mar 7 at 10:46












  • 1





    The Linux history command gives info on the last executed command so if you are using a common user to execute that command should be visible in history or in the .bash_history profile

    – error404
    Mar 7 at 9:24












  • you might be able to see the full command in ps -ef | grep 'docker'

    – scipsycho
    Mar 7 at 9:31






  • 1





    @yashbagarka I did not think about this cool workaround. I typed history | grep "docker run" and there it was :-). Thank you!

    – Luis Crespo
    Mar 7 at 10:17












  • @scipsycho I tried the ps -ef | grep "docker" and found that the docker command-line tool launches other processes and then dies. So what I see in the ps output is not the original docker command, but something else with very different parameters.

    – Luis Crespo
    Mar 7 at 10:20











  • @LuisCrespo update the question with answer. Pls accept it

    – error404
    Mar 7 at 10:46







1




1





The Linux history command gives info on the last executed command so if you are using a common user to execute that command should be visible in history or in the .bash_history profile

– error404
Mar 7 at 9:24






The Linux history command gives info on the last executed command so if you are using a common user to execute that command should be visible in history or in the .bash_history profile

– error404
Mar 7 at 9:24














you might be able to see the full command in ps -ef | grep 'docker'

– scipsycho
Mar 7 at 9:31





you might be able to see the full command in ps -ef | grep 'docker'

– scipsycho
Mar 7 at 9:31




1




1





@yashbagarka I did not think about this cool workaround. I typed history | grep "docker run" and there it was :-). Thank you!

– Luis Crespo
Mar 7 at 10:17






@yashbagarka I did not think about this cool workaround. I typed history | grep "docker run" and there it was :-). Thank you!

– Luis Crespo
Mar 7 at 10:17














@scipsycho I tried the ps -ef | grep "docker" and found that the docker command-line tool launches other processes and then dies. So what I see in the ps output is not the original docker command, but something else with very different parameters.

– Luis Crespo
Mar 7 at 10:20





@scipsycho I tried the ps -ef | grep "docker" and found that the docker command-line tool launches other processes and then dies. So what I see in the ps output is not the original docker command, but something else with very different parameters.

– Luis Crespo
Mar 7 at 10:20













@LuisCrespo update the question with answer. Pls accept it

– error404
Mar 7 at 10:46





@LuisCrespo update the question with answer. Pls accept it

– error404
Mar 7 at 10:46












1 Answer
1






active

oldest

votes


















1














Marking the answer.



linux history would be the best way to get the docker command you had executed earlier.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55040120%2fdocker-is-it-possible-to-get-the-full-command-line-that-launched-a-docker-conta%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Marking the answer.



    linux history would be the best way to get the docker command you had executed earlier.






    share|improve this answer



























      1














      Marking the answer.



      linux history would be the best way to get the docker command you had executed earlier.






      share|improve this answer

























        1












        1








        1







        Marking the answer.



        linux history would be the best way to get the docker command you had executed earlier.






        share|improve this answer













        Marking the answer.



        linux history would be the best way to get the docker command you had executed earlier.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 7 at 10:46









        error404error404

        55758




        55758





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55040120%2fdocker-is-it-possible-to-get-the-full-command-line-that-launched-a-docker-conta%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved