X Tutup
Skip to content

Can't ExecStartCmd execute some command? #400

@lisicongIBM

Description

@lisicongIBM

For Example:

ExecCreateCmd execCreateCmd = dockerClient.execCreateCmd(containerId);

// I want to create a file in container and write some thing in it.
// For Example cmd =["sed","-i","1a testtest","/opt/testfolder/testfile.txt"]
// For Example cmd =["echo","this is test data",">","/opt/testfolder/testfile.txt"]
execCreateCmd.withCmd(cmd);
String execCreateCmdId = execCreateCmd.exec().getId();
ExecStartCmd execStartCmd = dockerClient.execStartCmd(containerId);

// but it doesn't work. I can't write anything into testfile.txt
InputStream is = execStartCmd.withExecId(execCreateCmdId).exec();

Can't ExecStartCmd execute some command?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup