-
Notifications
You must be signed in to change notification settings - Fork 8
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
Build in Dockerfile that works for java and node #23
Conversation
✅ No Breaking Changes |
Makefile
Outdated
ifeq ($(LANGUAGE),node) | ||
FLAGS+= --plugin=protoc-gen-ts=$(NODE_DIR)/node_modules/.bin/protoc-gen-ts | ||
FLAGS+= --plugin=protoc-gen-grpc=$(NODE_DIR)/node_modules/.bin/grpc_tools_node_protoc_plugin | ||
FLAGS+= --plugin=protoc-gen-ts=/node_modules/.bin/protoc-gen-ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paths are absolut cause we know the location in the image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FLAGS+= --grpc_out=$(OUTPUT)
should probably be FLAGS+= --grpc_out=$(NODE_DIR)
so we don't create node stuff in the java output - this probably fixes the clean issue as well
@@ -51,8 +51,8 @@ clean: ## Deletes all generated files | |||
@echo "+ $@" | |||
rm -rf $(JAVA_DIR) || true | |||
rm -rf $(GO_DIR) || true | |||
rm -R `find node -type d \( -iname "*" ! -iname "node_modules" ! -iname "tests" \) -mindepth 1 -maxdepth 1` || true | |||
rm -rf `find $(NODE_DIR) -type d \( -iname "*" ! -iname "node_modules" ! -iname "tests" \) -mindepth 1 -maxdepth 1` 2> /dev/null || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get rid of usage printout of rm
when no files need to be deleted by passing the errout to /dev/null
✅ No Breaking Changes |
2 similar comments
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
4 similar comments
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
.github/workflows/pull-request.yml
Outdated
@@ -52,17 +52,14 @@ jobs: | |||
steps: | |||
- uses: actions/checkout@v2 | |||
|
|||
- name: make | |||
run: make LANGUAGE=java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still the default 👍 (so could be just make
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, does the job 👍 I just think the resulting image could be optimized in terms of size and the Makefile
does contain some now deprecated comments and a glitch in the node config
✅ No Breaking Changes |
10 similar comments
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
✅ No Breaking Changes |
ab07343
to
7e788d9
Compare
✅ No Breaking Changes |
1 similar comment
✅ No Breaking Changes |
7922d03
to
60a5598
Compare
✅ No Breaking Changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup history and go!
Dockerfile
Outdated
RUN mkdir -p /installer/protoc | ||
RUN unzip -o protoc.zip -d /installer/protoc/ | ||
|
||
FROM node:lts-stretch-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FROM node:lts-stretch-slim | |
FROM node:lts-alpine |
Das dürfte noch kleiner sein.
Dockerfile
Outdated
USER root | ||
COPY --from=installer /node_modules /node_modules | ||
COPY --from=installer /installer/protoc /usr/bin/protoc | ||
COPY --from=installer /installer/protoc-gen-grpc-java /usr/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USER root | |
COPY --from=installer /node_modules /node_modules | |
COPY --from=installer /installer/protoc /usr/bin/protoc | |
COPY --from=installer /installer/protoc-gen-grpc-java /usr/bin/ | |
USER node | |
COPY --chown=node:node --from=installer /node_modules /node_modules | |
COPY --chown=node:node --from=installer /installer/protoc /usr/bin/protoc | |
COPY --chown=node:node --from=installer /installer/protoc-gen-grpc-java /usr/bin/ |
Als root
ist nicht so gut, oder?
✅ No Breaking Changes |
1 similar comment
✅ No Breaking Changes |
merging with root user because with node user we got permission denied during CI. |
5a01989
to
6270d6f
Compare
✅ No Breaking Changes |
TODO: