The question is: What is the best practices for getting code into a container (git clone vs. copy vs. data container)

My answer: I use wget on the Github repo (branch master). Hope it helps!

FROM alpine:3.5


##############################################################################
# Install App
##############################################################################


WORKDIR $APP

RUN apk update && \
	apk upgrade && \
	apk --no-cache add tar curl tini \
    && apk --no-cache add --virtual devs gcc make python wget unzip ca-certificates \
	&& apk del devs gcc make python wget unzip ca-certificates \
	&& npm cache clean \
	&& rm -rf /tmp/npm*


##############################################################################
# PART ONE
# Install/copy FirePress_Klimax into casper from Github
##############################################################################
echo; echo; echo; \
echo "PART TWO ..."; echo; \

THEME_NAME_FROM="FirePress_Klimax"; \
THEME_NAME_INTO="casper"; \

GIT_URL="https://github.com/firepress-org/$THEME_NAME_FROM/archive/master.zip"; \

DIR_FROM="$DIR_THEMES/$THEME_NAME_FROM"; \
DIR_INTO="$DIR_THEMES/$THEME_NAME_INTO"; \

cd $DIR_THEMES; \
wget --no-check-certificate -O master.zip $GIT_URL; \
echo; echo; echo "List (12) $DIR_THEMES ..."; echo; ls -AlhF $DIR_THEMES; du -sh; echo; \

unzip $DIR_THEMES/master.zip; \
echo; echo; echo "List (13) $DIR_THEMES ..."; echo; ls -AlhF $DIR_THEMES; du -sh; echo; \

rm $DIR_THEMES/master.zip; \
echo; echo; echo "List (14) $DIR_THEMES ..."; echo; ls -AlhF $DIR_THEMES; du -sh; echo; \

mv $THEME_NAME_FROM-master $THEME_NAME_INTO; \
echo; echo; echo "List (15) $DIR_THEMES ..."; echo; ls -AlhF $DIR_THEMES; du -sh; echo; \

cd $GHOST_SOURCE; \
echo; echo; echo "List (16) $DIR_INTO ..."; echo; ls -AlhF $DIR_INTO; du -sh; echo; \

echo; echo; echo "Show $THEME_NAME_FROM version (17) ($DIR_INTO)"; echo; \
cat $DIR_INTO/package.json | grep "version"; \


##############################################################################
# # PART TWO
# Install Theme: XYZ
##############################################################################

# ... future themes
# ...
# ...


##############################################################################
# Clean up
##############################################################################
rm -rf /var/cache/apk/*; \
apk del wget unzip ca-certificates; \
echo "End of /RUN"; echo; echo; echo;à




P.S. If you have solid skills 🤓 with Docker Swarm, Linux and the things mention here and you would love 💚 to help a startup to launch 🔥 a solid project, I would love to get to know you 🍻. Buzz me 👋 on Twitter @askpascalandy. You can see the things that are done and the things we have to do here.