Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile into Vatz #590

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Add Dockerfile into Vatz #590

merged 3 commits into from
Aug 27, 2024

Conversation

xellos00
Copy link
Member

@xellos00 xellos00 commented Aug 21, 2024

1. Type of change

Please delete options that are not relevant.

  • New feature
  • Enhancement
  • Bug/fix (non-breaking change which fixes an issue)
  • others (anything other than above)

2. Summary

Please include a summary of the changes and which issue is fixed or solved.

Related: # (issue)
Add Dockerfile into Vatz, for the running a watcher, we need to dockerlize vatz, and then run it on k8s
and therefore this dockerlize vatz

You can test it via command

1. docker build -t vatz-app .
2. docker run -p 8080:9090 -v /path_to_your_config.yaml:/config/config.yaml vatz-app

Summary
close #338


3. Comments

Please, leave a comments if there's further action that requires.

 docker build -t vatz .

[+] Building 66.8s (12/15)                                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                                    0.0s
 => => transferring dockerfile: 857B                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                   1.7s
[+] Building 67.0s (12/15)                                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                                    0.0s
 => => transferring dockerfile: 857B                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                   1.7s
 => [internal] load metadata for docker.io/library/golang:1.20-buster                                                                                                                   1.7s
[+] Building 67.1s (12/15)                                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                                    0.0s
 => => transferring dockerfile: 857B                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                   1.7s
 => [internal] load metadata for docker.io/library/golang:1.20-buster                                                                                                                   1.7s
[+] Building 67.3s (12/15)                                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                                    0.0s
 => => transferring dockerfile: 857B                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                   1.7s
 => [internal] load metadata for docker.io/library/golang:1.20-buster                                                                                                                   1.7s
[+] Building 67.4s (12/15)                                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                                    0.0s
 => => transferring dockerfile: 857B                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                   1.7s
 => [internal] load metadata for docker.io/library/golang:1.20-buster                                                                                                                   1.7s
[+] Building 67.6s (12/15)                                                                                                                                                                   
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                                                           0.0s
 => [builder 1/5] FROM docker.io/library/golang:1.20-buster@sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572                                                    12.7s
 => => resolve docker.io/library/golang:1.20-buster@sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572                                                             0.0s
 => => sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572 988B / 988B                                                                                              0.0s
 => => sha256:c94784fe2595f1e1963b1dbdf525c4adfdab767569f19de7ef3da81c756e65dd 6.99kB / 6.99kB                                                                                          0.0s
 => => sha256:3b1c264c0ad4598c25048a6dbd3030086cc5c74000e11d04ac27944cb116aabb 17.58MB / 17.58MB                                                                                        4.4s
[+] Building 107.0s (16/16) FINISHED                                                                                                                                                         
 => [internal] load build definition from Dockerfile                                                                                                                                    0.0s
 => => transferring dockerfile: 857B                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                   1.7s
 => [internal] load metadata for docker.io/library/golang:1.20-buster                                                                                                                   1.7s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                                           0.0s
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                                                           0.0s
 => [builder 1/5] FROM docker.io/library/golang:1.20-buster@sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572                                                    12.7s
 => => resolve docker.io/library/golang:1.20-buster@sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572                                                             0.0s
 => => sha256:eb3f9ac805435c1b2c965d63ce460988e1000058e1f67881324746362baf9572 988B / 988B                                                                                              0.0s
 => => sha256:c94784fe2595f1e1963b1dbdf525c4adfdab767569f19de7ef3da81c756e65dd 6.99kB / 6.99kB                                                                                          0.0s
 => => sha256:3b1c264c0ad4598c25048a6dbd3030086cc5c74000e11d04ac27944cb116aabb 17.58MB / 17.58MB                                                                                        4.4s
 => => sha256:f86220e98c9d858143a68158dde675a0178854549511d9fee469767edfefc0d7 1.58kB / 1.58kB                                                                                          0.0s
 => => sha256:ac8bb7e1a32398e26c129ce64e2ddc3e7ec6c34d93424b247f16049f5a91cff4 50.45MB / 50.45MB                                                                                        1.6s
 => => sha256:b1e7e053c9f6f57c6d95002167a6d57aed6aacf04dd2f8e681cb4f74a7ca4381 51.87MB / 51.87MB                                                                                        3.1s
 => => sha256:ca7476af61726261111675c2e6336d1e7ad596d04e6e186455acb617f4500a02 68.87MB / 68.87MB                                                                                        4.4s
 => => extracting sha256:ac8bb7e1a32398e26c129ce64e2ddc3e7ec6c34d93424b247f16049f5a91cff4                                                                                               1.6s
 => => sha256:621832a6de2055ec43766c6dd0f6ef1d5e79a67cbe9e619cc8ed7112ddf01fb5 100.20MB / 100.20MB                                                                                      6.5s
 => => sha256:4b4a080cfa43ccb5c6af395f13749d724ce42fd858ee9f622c4887b25ef6a4fb 156B / 156B                                                                                              4.5s
 => => extracting sha256:3b1c264c0ad4598c25048a6dbd3030086cc5c74000e11d04ac27944cb116aabb                                                                                               0.9s
 => => extracting sha256:b1e7e053c9f6f57c6d95002167a6d57aed6aacf04dd2f8e681cb4f74a7ca4381                                                                                               1.9s
 => => extracting sha256:ca7476af61726261111675c2e6336d1e7ad596d04e6e186455acb617f4500a02                                                                                               1.7s
 => => extracting sha256:621832a6de2055ec43766c6dd0f6ef1d5e79a67cbe9e619cc8ed7112ddf01fb5                                                                                               2.6s
 => => extracting sha256:4b4a080cfa43ccb5c6af395f13749d724ce42fd858ee9f622c4887b25ef6a4fb                                                                                               0.0s
 => [internal] load build context                                                                                                                                                       0.1s
 => => transferring context: 104.38kB                                                                                                                                                   0.1s
 => [stage-1 1/3] FROM docker.io/library/debian:buster-slim@sha256:bb3dc79fddbca7e8903248ab916bb775c96ec61014b3d02b4f06043b604726dc                                                     7.3s
 => => resolve docker.io/library/debian:buster-slim@sha256:bb3dc79fddbca7e8903248ab916bb775c96ec61014b3d02b4f06043b604726dc                                                             0.0s
 => => sha256:bb3dc79fddbca7e8903248ab916bb775c96ec61014b3d02b4f06043b604726dc 984B / 984B                                                                                              0.0s
 => => sha256:32220ea48be72979c9f0810d69f3de9145c9584c2ee966c6ec26edbcf4640c0b 529B / 529B                                                                                              0.0s 
 => => sha256:e1a7bb630c8baa947c5430a7f0965ef6afe71e88e90547aced2e601a89b68399 1.46kB / 1.46kB                                                                                          0.0s 
 => => sha256:b338562f40a7fb7360dfae935da6d7e40d2545db18bc461d9d70ec1b2b657f33 27.34MB / 27.34MB                                                                                        6.3s 
 => => extracting sha256:b338562f40a7fb7360dfae935da6d7e40d2545db18bc461d9d70ec1b2b657f33                                                                                               0.9s 
 => [stage-1 2/3] WORKDIR /root/                                                                                                                                                        0.7s 
 => [builder 2/5] WORKDIR /app/vatz                                                                                                                                                     0.6s 
 => [builder 3/5] COPY . .                                                                                                                                                              0.3s 
 => [builder 4/5] RUN make build                                                                                                                                                       89.0s
 => [builder 5/5] RUN ./vatz init                                                                                                                                                       0.4s
 => [stage-1 3/3] COPY --from=builder /app/vatz/vatz ./vatz                                                                                                                             0.1s
 => exporting to image                                                                                                                                                                  0.2s
 => => exporting layers                                                                                                                                                                 0.2s
 => => writing image sha256:10cc022482586e6555403dd01f9f219560720764a4b543dbdb9b1c11054fa90e                                                                                            0.0s
 => => naming to docker.io/library/vatz    
image

@xellos00 xellos00 requested a review from a team August 21, 2024 01:25
@xellos00 xellos00 self-assigned this Aug 21, 2024
@xellos00 xellos00 added Vatz Project Name type:enhancement Any enhancement for feature or anything V1 V1 labels Aug 21, 2024
@xellos00 xellos00 requested review from rootwarp, meetrick, heejin-github and skonhwang and removed request for a team August 21, 2024 23:02
Copy link
Member

@heejin-github heejin-github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rootwarp
Copy link
Member

@xellos00 any plan to apply alpine linux rather than Debian?

- from Debian to Alpine
- from Debian to Alpine
@xellos00
Copy link
Member Author

xellos00 commented Aug 22, 2024

@xellos00 any plan to apply alpine linux rather than Debian?

Thanks for comment this out, I didn't do this in purpose. it's merely copied mistake from my test docker script. I was trying to change it either of arpine:latest or ubuntu:latest. I updated code because you are suggsting arpine for its lightwight.

Copy link
Member

@rootwarp rootwarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Additionally, I suggest to fix specific version rather using "latest" one. It could raise unexpected behavior when the image updated.

FYI. Alpine is de facto standard due to security and lightweight of its result.

@xellos00 xellos00 merged commit b86370c into dsrvlabs:main Aug 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Any enhancement for feature or anything V1 V1 Vatz Project Name
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerize VATZ
3 participants