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

removes .git from build layer, emulates GH build #1375

Merged
merged 2 commits into from
Jun 5, 2022
Merged

Conversation

umputun
Copy link
Owner

@umputun umputun commented Jun 1, 2022

this related to the discussion in #269

Remove .git from the docker build context and pass both GITHUB_REF and GITHUB_SHA from the make. It uses an updated baseimage defaulting to "local" if no git repo

@umputun umputun requested a review from paskal June 1, 2022 21:45
@umputun
Copy link
Owner Author

umputun commented Jun 1, 2022

@nagimov @bnoctis pls take a look

@paskal
Copy link
Sponsor Collaborator

paskal commented Jun 1, 2022

Doesn't it break the scenario where I just download the git repository and run docker build, producing local binary version instead of master? Even with make rundev in this branch I get remark42 local-20220601T17:52:14, I wonder if that's expected.

@umputun
Copy link
Owner Author

umputun commented Jun 1, 2022

yes, it does. it produces a "local" version unless it runs with make docker

upd: regarding rundev - there is no reason why it missing the branch/sha info, I just forgot to add it. Not sure if it even makes any sense for dev build, but will add

@paskal
Copy link
Sponsor Collaborator

paskal commented Jun 2, 2022

After last changes, make rundev still produces local build for me.

@umputun
Copy link
Owner Author

umputun commented Jun 2, 2022

After last changes, make rundev still produces local build for me.

probably your local compose missing this part i have added eafff01#diff-e1a5cf1531a00e0c8773ac834afc54983202fa6f7268566193ac6d09f45495d6R18

@nc7s
Copy link

nc7s commented Jun 2, 2022

I'll let @nagimov have the say, LGTM though

@nagimov
Copy link
Contributor

nagimov commented Jun 2, 2022

TLDR: LGTM


Unrelated build issues:

  • when building via docker build -t remark42 --build-arg SKIP_FRONTEND_TEST=true --build-arg SKIP_BACKEND_TEST=true . or make docker, getting the following error due to unset $BUILDPLATFORM. It seems like Dockerfile always expects $BUILDPLATFORM to be set, which only comes from dockerx make-target (via --platform), and not from docker make-target.
...
Step 15/52 : FROM --platform=$BUILDPLATFORM node:16.13.2-alpine as build-frontend-deps
failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument
make: *** [Makefile:14: docker] Error 1
  • fixed with sed -i 's/--platform=$BUILDPLATFORM//' Dockerfile
  • builds ok docker build -t remark42 --build-arg SKIP_FRONTEND_TEST=true --build-arg SKIP_BACKEND_TEST=true ., local instance http://127.0.0.1/web/ works as expected, properly tagged with version=gitless-docker-eafff01-YYYYMMDDTHH:MM:SS
  • docker build -t remark42 . gives a few failed backend tests, all frontend tests pass

@umputun umputun merged commit 6309443 into master Jun 5, 2022
@umputun umputun deleted the gitless-docker branch June 5, 2022 17:36
@paskal paskal added this to the v1.10.1 milestone Jun 12, 2022
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