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

Dockerfile based build plus create postgres-operator images #1066

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ReSearchITEng
Copy link
Contributor

@ReSearchITEng ReSearchITEng commented Jul 18, 2020

  1. Dockerfile based build of code (using existing Makefile) on alpine (instead of setting full developer env for simple/trivial tests)
    plus
  2. create postgres-operator-secure image as well as optional postgres-operator-alpine which holds full alpine os (less secure).

All in same Dockerfile.

This solution is ideal when someone wants to test/share an image with their PR directly from docker.io.
Locating this Dockerfile under root of the project, allows docker hub (docker.io) simple and automatic build of images for those forking the project.

Dockerfile builds two versions of the image: one with full alpine os, and a more secure one, from scratch (which is the last one, and the default).

BUILD.md publishes this information plus points to the docs/developer.md .

solves #1067

@FxKu
Copy link
Member

FxKu commented Jul 21, 2020

Should this replace the existing Dockerfile? In any case I would put new docker related files into this folder.

@ReSearchITEng
Copy link
Contributor Author

ReSearchITEng commented Jul 22, 2020

@FxKu

Should this replace the existing Dockerfile? In any case I would put new docker related files into this folder.

Ok, I've moved it there, but note it's more awkward to use docker.io when file is in a subfolder.
As the one in docker/ directory is used by Travis (and possibly by other tools also), I have renamed it, and documented their meaning.

@ReSearchITEng ReSearchITEng mentioned this pull request Aug 21, 2020
@Jan-M
Copy link
Member

Jan-M commented Aug 28, 2020

We will look into this, I like not having to deal with the setup in any way to build and test it. Once we are through with improving kind and e2e this should get some attention.

Would also need to understand the Docker hub situation, this may be useful indeed to make everyone's life easier.

@ReSearchITEng
Copy link
Contributor Author

ReSearchITEng commented Sep 8, 2020

Hi @Jan-M
Yes, the idea is to have a quick way for us (non core devs) to easily build the operator, usually only for adding more debug info or some small experiments, changes, tests, before we opening PRs or issues.

We also want to build using dockerhub. By default, when we connect github repo with dockerhub, it will look for a Dockerfile in the root of the project (hence my request to move this new docker/WithBuildDockerfile to the root of the project and name it Dockerfile).
This Dockerfile first builds the binary and then adds it in the final clean image.

So, it's cleaning the path to create the pgo and its image with zero setup and zero prerequisites.

@ReSearchITEng
Copy link
Contributor Author

ReSearchITEng commented Nov 14, 2020

Hi @Jan-M @FxKu ,
is there anything we can do to have this merged?
E.g. Should I simply add only one Dockerfile in the root of the project for the rest of us, without touching at all the existing folder with dockerfiles.
It would help us greatly, as we don't have pgo build machines and its dependencies. The proposed Dockerfile is only for rest us (non-zalando), while your existing systems will remain in place as they are, without any change, and without being affected at all.

@FxKu FxKu added this to the 1.7 milestone Dec 16, 2020
@FxKu FxKu modified the milestones: 1.6.1, 1.7 Feb 15, 2021
@FxKu FxKu modified the milestones: 1.7, 1.8 Mar 26, 2021
@FxKu FxKu modified the milestones: 1.7, 1.8 Aug 12, 2021
@FxKu FxKu removed this from the 1.8 milestone Mar 24, 2022
@FxKu FxKu added this to the 1.9 milestone Mar 24, 2022
@@ -9,6 +9,7 @@ COPY build/* /
RUN addgroup -g 1000 pgo
RUN adduser -D -u 1000 -G pgo -g 'Postgres Operator' pgo

USER 1000:1000
USER pgo:pgo

Choose a reason for hiding this comment

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

Hello, having "named" user prevents kubernetes to check for non root. I think it would be best to keep as it's now.

@FxKu FxKu modified the milestones: 1.9, 2.0 Jan 5, 2023
@FxKu FxKu modified the milestones: 1.11.0, 2.0 Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Open Questions
Development

Successfully merging this pull request may close these issues.

None yet

4 participants