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

Optimise Dockerfile #4

Open
bradmccoydev opened this issue Dec 8, 2022 · 7 comments
Open

Optimise Dockerfile #4

bradmccoydev opened this issue Dec 8, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@bradmccoydev
Copy link
Collaborator

Optimize Dockerfile to be better with size and security.

FROM cgr.dev/chainguard/wolfi-base:latest

COPY --from=build /jx-cdevents-adapter /jx-cdevents-adapter
	EXPOSE 80

# required for external tools to detect this as a go binary
ENV GOTRACEBACK=all

ENTRYPOINT [ "./jx-cdevents-adapter" ]
@bradmccoydev bradmccoydev added the enhancement New feature or request label Dec 8, 2022
@Kalpesh-18
Copy link

Hello, is this an open issue? I would be happy to work on it

@bradmccoydev
Copy link
Collaborator Author

Yes i have assigned to you!

@Kalpesh-18
Copy link

Hey, thanks for the assigning the issue. It would be great if you could briefly describe what you mean when you mention "optimized and better security."

@i-am-yuvi
Copy link
Contributor

I guess no one is working, Can I work on it?

@bradmccoydev
Copy link
Collaborator Author

Hey @i-am-yuvi sure no problem

@i-am-yuvi
Copy link
Contributor

Hey @bradmccoydev, I would like to suggest some changes:

  1. How about using a more lightweight base image golang:1.16-alpine3.14 which will eventually reduce the size of docker image
  2. We can also run the application as the non-root user to reduce the vulnerabilities that could occur if it run as a root user.

@i-am-yuvi
Copy link
Contributor

# Add a new user
RUN adduser -D myuser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants