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

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко