Skip to content

Commit

Permalink
Use shallow clone from GitHub instead of copying local tree
Browse files Browse the repository at this point in the history
We cannot use COPY since the user may have attempted to build mcjoin
locally first, in which case config.status may likely be incompatible
with our Alpine system.

Also, this makes the Dockerfile more stand-alone.

Signed-off-by: Joachim Nilsson <[email protected]>
  • Loading branch information
troglobit committed May 7, 2019
1 parent bda06db commit e20bc28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine:3.9
RUN apk add --update git build-base automake autoconf

COPY . /root/mcjoin
RUN git clone --depth=1 https://github.com/troglobit/mcjoin.git /root/mcjoin
WORKDIR /root/mcjoin
RUN apk add --update build-base automake autoconf

RUN ./autogen.sh
RUN ./configure --prefix=/usr
RUN make
Expand Down

3 comments on commit e20bc28

@gclawes
Copy link
Contributor

@gclawes gclawes commented on e20bc28 May 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relies on github being up to build the project, why not just clean config.status when building in docker?

@gclawes
Copy link
Contributor

@gclawes gclawes commented on e20bc28 May 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also hard to build in air-gapped environments where github may not be accessible.

@troglobit
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep the Dockerfiles I keep in my projects download from GitHub. Local preferences may of course vary, but I cannot take every end user's specific needs into concern.

Please sign in to comment.