Devlog #4
Hello!
I am now working on a big refactor (again).
I am planning to write a .sh script that can be used in either alpine or debian based image.
A rough description of what I am making from my previous Devlog:
I am making an OCI Image, basically a Docker image, that includes Nginx and a bunch of third-party modules and runs out of the box.
Leanred
I was almost new to .sh scripts. I knew it is similar to the command used in Terminal, but I didn’t know there are actually some huge difference.
-
caseandif- I learned how to use the
casecommand. - I learned more about the
ifcommand. - A quick example:
# /bin/sh # Example for Case case ${YOUR_ENV} in "Apple") echo "The ENV is Apple" # Ending symble ;; "Orange"|"Banana") echo "The ENV is either Orange or Banana" ;; # Ending symble esac # Example for if: # Conditions can be: [ -z ${YOUR_ENV} ] # If the ENV is empty [ ${YOUR_ENV} == "Hi" ] # If the ENV matches the string Hi # The space after the "[" and before the "]" is super important. It cannot be forgotten. # Read more about the space: # https://www.shellcheck.net/wiki/SC1020 if [ condition ]; then echo "The condition is True!" else echo "The condition is not True!" # Ending symble fi
- I learned how to use the
More information will be provided in the next Devlog (Devlog #5 ).
So many ARGs in the photo!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.