Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
FROM alpine:3.6

RUN apk update \
&& apk add \
tini \
git \
# Build
FROM alpine:3.7
RUN apk --no-cache add \
make \
g++ \
ncurses \
ncurses-dev \
&& ln -s /usr/include/curses.h /usr/include/cursesw.h

ADD . /root/pacvim
RUN cd /root/pacvim \
&& make install \
&& rm -rf /root/pacvim

RUN addgroup -g 1000 docker \
&& adduser -u 1000 -G docker -s /bin/sh -D docker

USER docker
ncurses-static \
binutils
RUN ln -s /usr/include/ncurses.h /usr/include/cursesw.h \
&& ln -s /usr/lib/libncursesw.a /usr/lib/libncurses.a
WORKDIR /root/pacvim
COPY . .
ENV CXXFLAGS='-Os -flto -ffunction-sections -fdata-sections'
ENV LDFLAGS='-static -s -Wl,--gc-sections'
RUN make -j4 install
RUN strip -R.comment -R.note /usr/local/bin/pacvim

ENTRYPOINT ["/sbin/tini", "/usr/local/bin/pacvim"]
# Run
FROM alpine:3.7
RUN apk --no-cache add \
ncurses-terminfo-base \
&& adduser -Du1000 pacvim
USER pacvim
WORKDIR /home/pacvim
COPY --from=0 /usr/local/bin/pacvim /usr/local/bin/pacvim
COPY --from=0 /usr/local/share/pacvim-maps /usr/local/share/pacvim-maps
ENTRYPOINT ["/usr/local/bin/pacvim"]