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

make only a shallow clone #95

Merged
merged 1 commit into from Nov 9, 2022

Conversation

stefan0xC
Copy link
Contributor

@stefan0xC stefan0xC commented Nov 2, 2022

In a docker build we don't keep the repository so it does not make sense to checkout the whole history, a shallow clone should suffice.

When updating the web-vault version we'd have to change the branch name too because it's not easily possible to checkout just a specific commit, I think.

@BlackDex
Copy link
Collaborator

BlackDex commented Nov 2, 2022

This is not really intuitive. It also breaks the docker ARG which you could use instead.

@stefan0xC
Copy link
Contributor Author

This is not really intuitive. It also breaks the docker ARG which you could use instead.

Do you know how?

@stefan0xC
Copy link
Contributor Author

stefan0xC commented Nov 2, 2022

Instead of the git clone we could do the following

WORKDIR /vault
RUN git init
RUN git remote add origin https://github.com/bitwarden/clients.git
RUN git fetch --depth 1 origin "${VAULT_VERSION}"
RUN git -c advice.detachedHead=false checkout "${VAULT_VERSION}"

@BlackDex
Copy link
Collaborator

BlackDex commented Nov 2, 2022

I don't think it is possible with a single command.
Also, we want to use a specific commit instead of tags, just to be sure.

Update: And i see you may have a solution here.
That could be an option, we just need to make sure it works fully.

Dockerfile Show resolved Hide resolved
Copy link
Collaborator

@BlackDex BlackDex left a comment

Choose a reason for hiding this comment

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

Looks like this works just fine for the build process.

@dani-garcia dani-garcia merged commit a890ed5 into dani-garcia:master Nov 9, 2022
@stefan0xC stefan0xC deleted the shallow-clone branch November 9, 2022 21:20
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.

None yet

4 participants