Initial commit
This commit is contained in:
3
kapitel10/10_1/Dockerfile
Normal file
3
kapitel10/10_1/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get -y install cowsay
|
||||
CMD ["/usr/games/cowsay", "Min egna Dockerfile"]
|
9
kapitel10/10_2/Dockerfile
Normal file
9
kapitel10/10_2/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get -y install \
|
||||
cowsay \
|
||||
procps \
|
||||
iputils-ping \
|
||||
dnsutils \
|
||||
curl \
|
||||
&& apt-get clean
|
||||
CMD ["/usr/games/cowsay", "Hej alla! Docker fungerar!"]
|
4
kapitel10/10_3_1/Dockerfile
Normal file
4
kapitel10/10_3_1/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM debian:11-slim
|
||||
COPY hej.sh /hej.sh
|
||||
RUN chmod +x /hej.sh
|
||||
CMD /hej.sh
|
5
kapitel10/10_3_1/hej.sh
Normal file
5
kapitel10/10_3_1/hej.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
|
||||
echo " _____________ "
|
||||
echo "| Hejsan alla |"
|
||||
echo " ------------- "
|
7
kapitel10/10_3_1_1/alice.Dockerfile
Normal file
7
kapitel10/10_3_1_1/alice.Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get install -y cowsay \
|
||||
&& apt-get clean
|
||||
COPY cow-say-alice.sh /cow-say-alice.sh
|
||||
RUN chmod +x /cow-say-alice.sh
|
||||
ADD http://jackbenny.se/docs/alice.txt /alice.txt
|
||||
CMD ["/cow-say-alice.sh"]
|
3
kapitel10/10_3_1_1/cow-say-alice.sh
Normal file
3
kapitel10/10_3_1_1/cow-say-alice.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/games"
|
||||
egrep "Down the Rabbit-Hole" /alice.txt -A 7 | cowsay
|
6
kapitel10/10_3_2/cowsay-entry.Dockerfile
Normal file
6
kapitel10/10_3_2/cowsay-entry.Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get -y install \
|
||||
cowsay \
|
||||
&& apt-get clean
|
||||
CMD ["CMD och ENTRYPOINT arbetar tillsammans"]
|
||||
ENTRYPOINT ["/usr/games/cowsay"]
|
9
kapitel10/10_3_3/alice.Dockerfile
Normal file
9
kapitel10/10_3_3/alice.Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get install -y cowsay \
|
||||
&& apt-get clean
|
||||
RUN mkdir -p /opt/alice
|
||||
WORKDIR /opt/alice
|
||||
COPY cow-say-alice.sh cow-say-alice.sh
|
||||
RUN chmod +x cow-say-alice.sh
|
||||
ADD http://jackbenny.se/docs/alice.txt alice.txt
|
||||
CMD ["/opt/alice/cow-say-alice.sh"]
|
3
kapitel10/10_3_3/cow-say-alice.sh
Normal file
3
kapitel10/10_3_3/cow-say-alice.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/games"
|
||||
egrep "Down the Rabbit-Hole" alice.txt -A 7 | cowsay
|
11
kapitel10/10_3_4/alice-kalle.Dockerfile
Normal file
11
kapitel10/10_3_4/alice-kalle.Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get install -y cowsay \
|
||||
&& apt-get clean
|
||||
RUN useradd -m -s /bin/bash --user-group kalle
|
||||
USER kalle
|
||||
WORKDIR /home/kalle
|
||||
COPY --chown=kalle:kalle cow-say-alice.sh cow-say-alice.sh
|
||||
RUN chmod +x cow-say-alice.sh
|
||||
ADD --chown=kalle:kalle http://jackbenny.se/docs/alice.txt \
|
||||
alice.txt
|
||||
CMD ["/home/kalle/cow-say-alice.sh"]
|
5
kapitel10/10_3_5/volym-test.Dockerfile
Normal file
5
kapitel10/10_3_5/volym-test.Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM debian:11-slim
|
||||
RUN mkdir /en-volym
|
||||
RUN echo "Hejsan" > /en-volym/minfil.txt
|
||||
VOLUME /en-volym
|
||||
CMD ["/bin/cat", "/en-volym/minfil.txt"]
|
8
kapitel10/10_3_6/webb.Dockerfile
Normal file
8
kapitel10/10_3_6/webb.Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get install -y apache2 \
|
||||
&& apt-get clean
|
||||
ADD --chown=www-data:www-data \
|
||||
http://jackbenny.se/docs/hej-docker.html \
|
||||
/var/www/html/index.html
|
||||
EXPOSE 80/tcp
|
||||
CMD ["apache2ctl", "-D", "FOREGROUND"]
|
5
kapitel10/10_3_7/Dockerfile
Normal file
5
kapitel10/10_3_7/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM mysql:5.7.30
|
||||
ENV MYSQL_DATABASE=min_wiki \
|
||||
MYSQL_USER=wikiuser \
|
||||
MYSQL_PASSWORD=s3cr3t \
|
||||
MYSQL_ROOT_PASSWORD=supers3cr3t
|
7
kapitel10/10_3_8/Dockerfile
Normal file
7
kapitel10/10_3_8/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM mysql:5.7.30
|
||||
ENV MYSQL_DATABASE=min_wiki \
|
||||
MYSQL_USER=wikiuser \
|
||||
MYSQL_PASSWORD=s3cr3t \
|
||||
MYSQL_ROOT_PASSWORD=supers3cr3t
|
||||
LABEL version="1.0"
|
||||
LABEL author="Kalle"
|
12
kapitel10/10_3_9/Dockerfile
Normal file
12
kapitel10/10_3_9/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get install -y apache2 \
|
||||
curl \
|
||||
&& apt-get clean
|
||||
ADD --chown=www-data:www-data \
|
||||
http://jackbenny.se/docs/hej-docker.html \
|
||||
/var/www/html/index.html
|
||||
EXPOSE 80/tcp
|
||||
HEALTHCHECK --interval=30s --timeout=3s \
|
||||
--start-period=30s \
|
||||
CMD curl -f http://localhost || exit 1
|
||||
CMD ["apache2ctl", "-D", "FOREGROUND"]
|
6
kapitel10/10_4/loggar.Dockerfile
Normal file
6
kapitel10/10_4/loggar.Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM debian:11-slim
|
||||
RUN useradd -m -s /bin/bash --user-group kalle
|
||||
COPY --chown=kalle:kalle skript.sh /skript.sh
|
||||
RUN chmod +x /skript.sh
|
||||
USER kalle
|
||||
CMD ["/skript.sh"]
|
7
kapitel10/10_4/skript.sh
Normal file
7
kapitel10/10_4/skript.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
PATH="/bin:/sbin:/usr/local/bin:/usr/local/sbin"
|
||||
while true
|
||||
do
|
||||
echo "Klockan är $(date +'%T')"
|
||||
sleep 7
|
||||
done
|
Reference in New Issue
Block a user