-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 940 Bytes
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# First stage of Dockerfile
FROM alpine:latest AS build
RUN apk add --no-cache build-base cmake git bash autoconf automake libtool texinfo patch pkgconfig python3 ccache bison flex \
&& ln -sf python3 /usr/bin/python
COPY . /src
# Use ccache and parallel build
RUN --mount=type=cache,target=/root/.ccache \
cd /src && mkdir -p build && cd build && \
cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. && \
make -j$(nproc)
# Second stage of Dockerfile
FROM alpine:latest
# Instalar dependencias en tiempo de ejecución para que la imagen sea útil
RUN apk add --no-cache bash git make cmake python3
ENV VITASDK /usr/local/vitasdk
ENV PATH ${VITASDK}/bin:$PATH
RUN adduser -D user &&\
echo "export VITASDK=${VITASDK}" > /etc/profile.d/vitasdk.sh && \
echo 'export PATH=$PATH:$VITASDK/bin' >> /etc/profile.d/vitasdk.sh
COPY --from=build --chown=user /src/build/vitasdk ${VITASDK}