-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (16 loc) · 734 Bytes
/
Dockerfile
File metadata and controls
22 lines (16 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM ubuntu as builder
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --yes build-essential file gcc-multilib
COPY Dockerfile /etc/Dockerfile
RUN touch /etc/Dockerfile
COPY src/tinyweb.c /tmp/tinyweb.c
RUN gcc -m32 --static -o /usr/local/bin/tinyweb /tmp/tinyweb.c && /usr/local/bin/tinyweb -h
FROM alpine
COPY --from=builder /usr/local/bin/tinyweb /usr/local/bin/tinyweb
RUN chmod +x /usr/local/bin/tinyweb ; /usr/local/bin/tinyweb -h
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN echo '<html><head><title>It works!</title></head><body>It works!</body></html>' > /www/index.html
EXPOSE 80
WORKDIR /www
ENTRYPOINT [ "/entrypoint.sh" ]