-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
DNS resolution in k8s #124
Comments
It looks like installing bind-tools on alpine only fixes the shell commands but won't fix node. I'll need to build a debian-based image. |
I can offer a Dockerfile (create PR) for a distroless image I got working for Christams-Community-Groups v1.35.0 (and therefore should work for Christams-Community v1.35.0 at least) but then never used since it only decreased the size by 20 MB |
@BigPig22 sorry forgot to comment, if you want you can try, but I only tested it on 1.35.0 not nightly, add FROM node:20-alpine as builder-distroless
RUN apk --no-cache add curl
# RUN apk --no-cache add touch
ENV NODE_ENV production
ENV PORT 80
ENV DB_EXPOSE_PORT 8080
ENV DB_PREFIX /data/dbs/
ENV SECRET_DIRNAME /data
WORKDIR /usr/src/app
COPY . .
RUN npm install --production --silent \
&& mkdir -p /data/dbs
RUN touch /data/dbs/.dockerkeep
#RUN npm run build
#ENV NODE_ENV=production
#WORKDIR /app/express
#RUN npm install
RUN curl -sf https://gobinaries.com/tj/node-prune | /bin/sh && \
node-prune
# Tag as :distroless and :<version>-distroless
# build this version using --target release-distroless
FROM gcr.io/distroless/nodejs20-debian11 as release-distroless
#COPY --from=builder-distroless /app/react/build /app/react/build
COPY --from=builder-distroless /usr/src/app/node_modules /usr/src/app/node_modules
COPY --from=builder-distroless /data/dbs /data/dbs
COPY --from=builder-distroless /usr/src/app/src /usr/src/app/src
COPY --from=builder-distroless /usr/src/app/package.json usr/src/app/package.json
WORKDIR /usr/src/app
EXPOSE 80
CMD ["src/index.js"]
|
The docker alpine image is known for problems with dns resolution in k8s.
Can you therefore please add either the bind-tools packages via apk install or switch to the slim version of the node base image?
See: https://stackoverflow.com/questions/65181012/does-alpine-have-known-dns-issue-within-kubernetes
The text was updated successfully, but these errors were encountered: