1
0
Fork 0

Rename part1

This commit is contained in:
Vili Sinervä 2023-03-15 13:24:55 +02:00
parent bcf1e3361f
commit 108f52dbd5
21 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1 @@
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

View file

@ -0,0 +1,2 @@
[devops@devops ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

View file

@ -0,0 +1,2 @@
[devops@devops ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE

View file

@ -0,0 +1,16 @@
[devops@devops part1]$ docker run -d -it devopsdockeruh/simple-web-service:ubuntu
[devops@devops part1]$ docker exec -it gifted_boyd bash
root@b9703c4c7c48:/usr/src/app# tail -f ./text.log
Secret message is: 'You can find the source code here: https://github.com/docker-hy'
2023-03-13 11:04:51 +0000 UTC
2023-03-13 11:04:53 +0000 UTC
2023-03-13 11:04:55 +0000 UTC
2023-03-13 11:04:57 +0000 UTC
2023-03-13 11:04:59 +0000 UTC
Secret message is: 'You can find the source code here: https://github.com/docker-hy'
2023-03-13 11:05:01 +0000 UTC
2023-03-13 11:05:03 +0000 UTC
2023-03-13 11:05:05 +0000 UTC
2023-03-13 11:05:07 +0000 UTC
2023-03-13 11:05:09 +0000 UTC
root@b9703c4c7c48:/usr/src/app# exit

View file

@ -0,0 +1,24 @@
[devops@devops part1]$ docker run --name curl -it ubuntu sh -c 'while true; do echo "Input website:"; read website; echo "Searching.."; sleep 1; curl http://$website; done'
Input website:
helsinki.fi
Searching..
sh: 1: curl: not found
Open another terminal:
[devops@devops part1]$ docker exec -it curl bash
root@6774b835507a:/# apt install curl
-> Failed due to missing package db
root@6774b835507a:/# apt update
root@6774b835507a:/# apt install curl
root@6774b835507a:/# exit
Back in original terminal:
Input website: helsinki.fi
Searching..
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.20.1</center>
</body>
</html>

View file

@ -0,0 +1,10 @@
Image sizes:
Ubuntu - 83MB
Alpine - 15.7MB
[devops@devops part1]$ docker run -d -it devopsdockeruh/simple-web-service:alpine
[devops@devops part1]$ docker exec -it modest_curie sh
/usr/src/app # tail -f text.log
2023-03-13 11:54:03 +0000 UTC
2023-03-13 11:54:05 +0000 UTC
Secret message is: 'You can find the source code here: https://github.com/docker-hy'

View file

@ -0,0 +1,4 @@
[devops@devops part1]$ docker run -it devopsdockeruh/pull_exercise
Give me the password: basics
You found the correct password. Secret message is:
"This is the secret message"

View file

@ -0,0 +1,5 @@
FROM ubuntu:20.04
WORKDIR /usr/src/app
RUN apt update && apt install -y curl
COPY web-server.sh .
CMD ./web-server.sh

View file

@ -0,0 +1,6 @@
while true
do
echo "Input website:"
read website; echo "Searching.."
sleep 1; curl http://$website
done

View file

@ -0,0 +1,2 @@
FROM devopsdockeruh/simple-web-service:alpine
CMD server

View file

@ -0,0 +1,6 @@
[devops@devops part1]$ docker run --rm web-server
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. - using env: export GIN_MODE=release - using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /*path --> server.Start.func1 (3 handlers)
[GIN-debug] Listening and serving HTTP on :8080

View file

@ -0,0 +1 @@
[devops@devops part1] touch text.log && docker run -v "$(pwd)/text.log:/usr/src/app/text.log" --rm devopsdockeruh/simple-web-service

View file

@ -0,0 +1,8 @@
Command used:
[devops@devops part1]$ docker run --rm -p 8080:8080 web-server
I then connected to http://devops:8080/ with Firefox from another machine and received:
{"message":"You connected to the following path: /","path":"/"}

View file

@ -0,0 +1,8 @@
FROM openjdk:8-oracle
EXPOSE 8080
WORKDIR /usr/src/app
COPY pom.xml ./
COPY . .
RUN ./mvnw package
CMD ["java", "-jar", "./target/docker-example-1.1.3.jar"]

View file

@ -0,0 +1,8 @@
FROM node:16.19
EXPOSE 5000
WORKDIR /usr/src/app
COPY package*.json ./
COPY . .
RUN npm install && npm run build
RUN npm install -g serve
CMD ["serve", "-s", "-l", "5000", "build"]

View file

@ -0,0 +1,6 @@
FROM golang:1.16
EXPOSE 8080
WORKDIR /usr/src/app
COPY . .
RUN go build
CMD ["./server"]

View file

@ -0,0 +1 @@
docker run --rm -it -p 8080:8080 example-backend:1.13

View file

@ -0,0 +1,7 @@
FROM golang:1.16
EXPOSE 8080
WORKDIR /usr/src/app
COPY . .
ENV REQUEST_ORIGIN=http://devops:5000
RUN go build
CMD ["./server"]

View file

@ -0,0 +1,9 @@
FROM node:16.19
EXPOSE 5000
WORKDIR /usr/src/app
COPY package*.json ./
COPY . .
ENV REACT_APP_BACKEND_URL=http://devops:8080
RUN npm install && npm run build
RUN npm install -g serve
CMD ["serve", "-s", "-l", "5000", "build"]

View file

@ -0,0 +1,2 @@
docker run --rm -it -p 5000:5000 example-frontend:1.14
docker run --rm -it -p 8080:8080 example-backend:1.14

View file

@ -0,0 +1,5 @@
GitHub repository with README etc.:
https://github.com/ArcticCoder/dockerhub-demo
Dockerhub page:
https://hub.docker.com/r/arcticcoder/dockerhub-demo