Skip to main content
added 32 characters in body
Source Link
janos
  • 111.7k
  • 15
  • 152
  • 391

Do you really have a good reason for this permission setup?

RUN chmod 777 /root/startup.sh

It's s buta bit ironic to use the -v flag of tar, and then redirecting the output to /dev/null here:

RUN tar -xvzf httpd-2.4.18.tar.gz >/dev/null

You can drop that flag and the redirection, the outcome should be the same.


I'm not very familiar with Docker, but I'm wondering what will happen if any of the commands fail. For example, if make fails, you probably don't want to run the make install command that follows it. I don't have a solution for that, but error handling is something to think about.


The repetitive redirections and duplicated strings don't look pretty, and look hard to maintain. There gotta be a better way. Perhaps you could put the shell commands into a proper .bash script, enjoy all the power of regular bash scripting (variables, functions), and in the docketdocker file just fetch that script using wgetwget, and then runexecute it.

Do you really have a good reason for this permission setup?

RUN chmod 777 /root/startup.sh

It's s but ironic to use the -v flag of tar, and then redirecting the output to /dev/null here:

RUN tar -xvzf httpd-2.4.18.tar.gz >/dev/null

You can drop that flag and the redirection.


I'm not very familiar with Docker, but I'm wondering what will happen if any of the commands fail. For example, if make fails, you probably don't want to run the make install command that follows it. I don't have a solution for that, but error handling is something to think about.


The repetitive redirections and duplicated strings don't look pretty, and look hard to maintain. There gotta be a better way. Perhaps you could put the shell commands into a proper .bash script, enjoy all the power of regular bash scripting, and in the docket file just fetch that script using wget, and then run it.

Do you really have a good reason for this permission setup?

RUN chmod 777 /root/startup.sh

It's a bit ironic to use the -v flag of tar, and then redirecting the output to /dev/null here:

RUN tar -xvzf httpd-2.4.18.tar.gz >/dev/null

You can drop that flag and the redirection, the outcome should be the same.


I'm not very familiar with Docker, but I'm wondering what will happen if any of the commands fail. For example, if make fails, you probably don't want to run the make install command that follows it. I don't have a solution for that, but error handling is something to think about.


The repetitive redirections and duplicated strings don't look pretty, and look hard to maintain. There gotta be a better way. Perhaps you could put the shell commands into a proper .bash script, enjoy all the power of regular bash scripting (variables, functions), and in the docker file just fetch that script using wget, and then execute it.

Source Link
janos
  • 111.7k
  • 15
  • 152
  • 391

Do you really have a good reason for this permission setup?

RUN chmod 777 /root/startup.sh

It's s but ironic to use the -v flag of tar, and then redirecting the output to /dev/null here:

RUN tar -xvzf httpd-2.4.18.tar.gz >/dev/null

You can drop that flag and the redirection.


I'm not very familiar with Docker, but I'm wondering what will happen if any of the commands fail. For example, if make fails, you probably don't want to run the make install command that follows it. I don't have a solution for that, but error handling is something to think about.


The repetitive redirections and duplicated strings don't look pretty, and look hard to maintain. There gotta be a better way. Perhaps you could put the shell commands into a proper .bash script, enjoy all the power of regular bash scripting, and in the docket file just fetch that script using wget, and then run it.