You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user should be able to use inferred sync to reference files from a specific target in a multi-stage Dockerfile regardless of the position of that target stage in the Dockerfile:
ARG IMAGENAME=node
ARG IMAGETAG=16-slim
FROM ${IMAGENAME}:${IMAGETAG} AS base
EXPOSE 3000
RUN useradd -ms /bin/bash nodejs
WORKDIR /app
RUN chown -R nodejs /app
ENV NEXT_TELEMETRY_DISABLED 1
FROM base AS deps
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
FROM base AS development
ENV NODE_ENV development
COPY --chown=nodejs . .
COPY --from=deps /app/node_modules ./node_modules
CMD ["yarn", "dev"]
FROM development AS builder
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline
FROM base AS production
ENV NODE_ENV production
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
USER nodejs
CMD ["yarn", "start"]
Workaround
There are two workaround:
Place the desired target stage last in the Dockerfile.
Expected behavior
A user should be able to use inferred sync to reference files from a specific target in a multi-stage Dockerfile regardless of the position of that target stage in the Dockerfile:
Actual behavior
The inferencing code only considers the last stage in the Dockerfile, and so the inferencing may not work.
Skaffold should examine the named stage when specified rather than the last stage.
Information
Example from @tclasen https://github.com/tclasen/example/tree/broken_hot_reloading
Dockerfile:
Workaround
There are two workaround:
Dockerfile
.The text was updated successfully, but these errors were encountered: