2

I have a linux shell command, that need to be written in a Dockerfile.

for ((i=10001; i<10101; ++i)); do pwgen -n -s -B -c 10 | sed "s/^/$i /"; done > user.tx_ ; /bin/cp -f user.tx_ user.txt ; 

Anybody can help me ? Thank you very much.

0

2 Answers 2

3

You can use the RUN keyword in order to execute stuff.
If it's shell command you want to run, you can run bash -c with your shecl script.

See some examples and doc here:. https://docs.docker.com/engine/reference/builder/#run

Sign up to request clarification or add additional context in comments.

1 Comment

All right.Actually I need the Dockfile codes.I have tried many times.
0

This can provide you with a shell inside the container:

docker exec dockernamehere bash 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.