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

New base image #187

Merged
merged 5 commits into from
Mar 29, 2022
Merged

New base image #187

merged 5 commits into from
Mar 29, 2022

Conversation

roypaulin
Copy link
Collaborator

This PR replace the base image of the vertica-k8s. It was CentOS 7 before and now it uses a recent ubuntu image. Some changes have been made mainly in the Dockerfile to have a valid and lighter image.

@spilchen
Copy link
Collaborator

What is the size of the new image compared to the CentOS based one? Can you run a security scan and compare it against the CentOS one?

@roypaulin
Copy link
Collaborator Author

I have done that. The size is 823MB compared to 888MB with CentOS. About vulnerabilities with ubuntu I get with trivy I get 62 vulnerabilities: 36Low and 26Medium, CentOS: 802, LOW: 422, MEDIUM: 378, HIGH: 2

&& /usr/sbin/groupadd -r verticadba --gid ${DBADMIN_GID} \
&& /usr/sbin/useradd -r -m -s /bin/bash -g verticadba --uid ${DBADMIN_UID} dbadmin \
&& /etc/init.d/ssh start \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we start the ssh server here? It won't be running when we start the container.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it is useless. I had a "Missing privilege separation directory: /run/sshd" and adding this seems to fix that. The true fix was just to create the /run/sshd dir. So Yes I will remove this in my next commit.


ADD ./packages/init.d.functions /etc/rc.d/init.d/functions


# make the "en_US.UTF-8" locale so vertica will be utf-8 enabled by default
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we combine this RUN command with the one below? That will save a layer in the docker image.


&& rm -rf /run/nologin \
# Moving this because on Ubuntu crontab files are in /var/spool/cron/crontabs/
&& mv /var/spool/cron/dbadmin /var/spool/cron/crontabs/ \
Copy link
Collaborator

Choose a reason for hiding this comment

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

We copy dbadmin at line 98. Can we just change the destination directory and remove this line?

# Permit ssh connections
&& rm -rf /run/nologin

&& rm -rf /run/nologin \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this nologin file exist in ubuntu? I thought was a CentOS/RHEL thing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No it does not exit. I forgot to remove it.

@spilchen
Copy link
Collaborator

Also, we should have a changie for this to indicate we changed the OS that the container runs in.

Copy link
Collaborator

@spilchen spilchen left a comment

Choose a reason for hiding this comment

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

The latest changes are good. I don't have any further comments on it. Lets make sure this new image runs against a hdfs/kerberos setup -- our CI covers hdfs but not kerberos.

@spilchen
Copy link
Collaborator

Can you add ubuntu to the tests/external-images-build.txt file?

Copy link
Collaborator

@spilchen spilchen left a comment

Choose a reason for hiding this comment

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

Looks good.

@spilchen spilchen merged commit c7eca0e into vertica:main Mar 29, 2022
@roypaulin roypaulin deleted the new-base-image branch October 19, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants