通过MacOS加载图像的Docker运行网站,而不是在服务器上运行

发布于 2025-01-22 20:46:33 字数 611 浏览 2 评论 0原文

在MacOS上开发时,我通过Docker运行了一个网站,默认情况下设置了使用案例不敏感的文件系统。

当我运行网站时,我正在通过Docker在本地没有任何问题的图像。当我部署时,它不起作用。经检查,我发现图像为this_is_my_image.jpg,但我请求this_is_my_image.jpg

我的[不正确]假设是,使用Docker我将获得Linux的优势,因为它默认为案例敏感,但似乎文件系统已继承到Docker中 - 这意味着我的Docker Image(node:fermium-buster:fermium-buster) -slim)正在运行不敏感的文件系统吗?

我的dockerfile.dev是:

FROM node:fermium-buster-slim

ARG GID=1000
ARG UID=1000

USER ${UID}:${GID}

WORKDIR /usr/app

COPY . .

EXPOSE 3000

ENTRYPOINT [ "npm", "run", "dev" ]

生产图像在Linux系统上运行,这使我认为是这种情况?

I run a website via Docker as I develop on macOS and macOS is set up with a case-insensitive filesystem by default.

When I run the site, I was rendering an image with no issues locally via Docker. When I deployed, it didn't work. Upon inspection I found that the image was This_Is_My_Image.jpg, yet I was requesting this_is_my_image.jpg.

My [incorrect] assumption was that using Docker I would gain the advantage of Linux with it being case-sensitive as default but it seems that the file system is inherited into Docker - meaning that my Docker image (node:fermium-buster-slim) is running a file system which is case-insensitive?

My Dockerfile.dev is:

FROM node:fermium-buster-slim

ARG GID=1000
ARG UID=1000

USER ${UID}:${GID}

WORKDIR /usr/app

COPY . .

EXPOSE 3000

ENTRYPOINT [ "npm", "run", "dev" ]

The production image runs on a Linux system which makes me think that this is the case?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文