-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (34 loc) · 1.25 KB
/
Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ARG DOCKER_IMAGE=alpine:latest
FROM $DOCKER_IMAGE AS builder
RUN apk add --no-cache gcc make musl-dev git \
&& git clone --recurse-submodules https://github.com/TinyCC/tinycc.git
WORKDIR /tinycc
#--CPU=x86_64
RUN ./configure --config-musl \
&& make -j$(nproc) \
&& make test -j$(nproc) \
&& make install
ARG DOCKER_IMAGE=alpine:latest
FROM $DOCKER_IMAGE AS runtime
LABEL author="Bensuperpc <bensuperpc@gmail.com>"
LABEL mantainer="Bensuperpc <bensuperpc@gmail.com>"
ARG VERSION="1.0.0"
ENV VERSION=$VERSION
RUN apk add --no-cache musl-dev make
COPY --from=builder /usr/local /usr/local
ENV PATH="/usr/local/bin:${PATH}"
ENV CC=/usr/local/bin/tcc
WORKDIR /usr/src/myapp
# Test if compiler work
RUN tcc -v
CMD ["tcc", "-v"]
LABEL org.label-schema.schema-version="1.0" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="bensuperpc/docker-tinycc" \
org.label-schema.description="build tinycc compiler" \
org.label-schema.version=$VERSION \
org.label-schema.vendor="Bensuperpc" \
org.label-schema.url="http://bensuperpc.com/" \
org.label-schema.vcs-url="https://github.com/Bensuperpc/docker-tinycc" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.docker.cmd="docker build -t bensuperpc/docker-tinycc -f Dockerfile ."