EXEC & SHELL Forms of commands gives errors

Hi,

Can anyone help as to which are correct and which are not, since if I try to use in build, one or the other gives errors.

EXEC FORM

RUN ["/bin/bash", "-c", "echo hello"]
RUN [“/bin/bash”,"-c","yum update -y && yum upgrade -y"]
RUN ["/bin/bash","-c","yum install iputils-ping -y"]
RUN ["/bin/bash", "-c", "echo hello"]
RUN ["/bin/bash",”-c”,"ping google.com"]
CMD ["echo","Hello Docker!"]

SHELL FORM

RUN yum update -y && yum upgrade -y
RUN yum install apache2
RUN yum install iputils-ping -y
RUN ping google.com
#In the shell form you can use a \ (backslash) to continue a single RUN instruc>
#SHELL FORM
RUN /bin/bash -c 'source $HOME/.bashrc && \
echo $HOME'
RUN /bin/bash -c 'source $HOME/.bashrc && echo $HOME'
CMD echo Hello docker!