Skip to content
Snippets Groups Projects
Commit 8e31350a authored by Florent Gluck's avatar Florent Gluck
Browse files

fixed typos in lab8

added solutions to lab8
parent 67ff6011
No related branches found
No related tags found
No related merge requests found
No preview for this file type
FROM alpine:3.21
RUN apk update && apk add darkhttpd
RUN mkdir /var/www/darkhttpd
COPY index.html /var/www/darkhttpd
CMD ["darkhttpd", "/var/www/darkhttpd", "--port", "2000"]
FROM alpine:3.21
RUN apk update
RUN apk add darkhttpd
RUN adduser -S -D -H www
RUN mkdir -p /var/www/darkhttpd
COPY index.html /var/www/darkhttpd
USER www
CMD ["darkhttpd", "/var/www/darkhttpd", "--port", "2000"]
FROM alpine:3.21
RUN apk update
RUN apk add darkhttpd
RUN adduser -S -D -H www
RUN mkdir -p /var/www/darkhttpd
USER www
CMD ["darkhttpd", "/var/www/darkhttpd", "--port", "2000"]
<!DOCTYPE html>
<html>
<body>
<h1>Welcome to darkhttpd!</h1>
<p>If you see this page, it means the darkhttpd web server is running successfully.</p>
<p>Check the project's homepage at <a href="https://unix4lyfe.org/darkhttpd/">https://unix4lyfe.org/darkhttpd/</a></p>
</body>
</html>
\ No newline at end of file
FROM alpine:3.21
RUN apk update && apk add imagemagick libjpeg-turbo
WORKDIR /shared
ADD img_conv.sh /usr/local/bin
ENTRYPOINT ["sh","/usr/local/bin/img_conv.sh"]
#!/bin/sh
if [ $# -lt 2 ]; then
echo "Usage: fmt images"
echo " fmt: output image format, e.g. png"
echo " images: images to convert to the specified format"
exit 0
fi
fmt=$1
shift
mogrify -format $fmt $@
FROM debian:12
RUN apt-get update && apt-get install -y wget make gcc libncurses-dev && \
cd /tmp && \
wget https://www.alessandropira.org/alienwave/alienwave-0.4.0.tar.gz && \
tar fxz alienwave-0.4.0.tar.gz && \
cd /tmp/alienwave && \
cat Makefile|sed s/"\-lncurses"/"\-lncurses -ltinfo -static"/g > Makefile2 && \
mv Makefile2 Makefile && \
make && \
mv alienwave /usr/local/bin && \
rm -rf /tmp/* && \
apt-get remove -y wget make gcc libncurses-dev && \
apt-get clean && \
apt autoremove -y && \
rm -rf /var/lib/apt/lists /var/cache/apt
CMD ["/usr/local/bin/alienwave"]
# Builder stage
FROM debian:12 AS builder
RUN apt-get update
RUN apt-get install -y wget make gcc libncurses-dev
WORKDIR /tmp
RUN wget https://www.alessandropira.org/alienwave/alienwave-0.4.0.tar.gz && tar fxz alienwave-0.4.0.tar.gz
WORKDIR /tmp/alienwave
RUN cat Makefile|sed s/"\-lncurses"/"\-lncurses -ltinfo -static"/g > Makefile2 && mv Makefile2 Makefile
RUN make
# Final stage which uses the builder stage
# Image size: 11.3MB
FROM alpine:latest
RUN apk update && apk add ncurses
COPY --from=builder /tmp/alienwave/alienwave /usr/bin
CMD ["/usr/bin/alienwave"]
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y golang ca-certificates
RUN go install github.com/alfg/asciicat@latest
RUN cp /root/go/bin/asciicat /usr/bin
WORKDIR /images
ENTRYPOINT ["asciicat", "-i"]
FROM ubuntu:24.04 AS builder
RUN apt-get update && apt-get install -y golang ca-certificates
RUN go install github.com/alfg/asciicat@latest
FROM alpine:3.21
WORKDIR /images
COPY --from=builder /root/go/bin/asciicat /usr/bin
ENTRYPOINT ["asciicat", "-i"]
FROM scratch
WORKDIR /bin
COPY asciicat /bin
WORKDIR /images
ENTRYPOINT ["/bin/asciicat", "-i"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment