简体   繁体   English

Gimp 不会在云端运行,但可以从本地 docker 镜像运行

[英]Gimp won't run on cloud run but works from local dockers image

As the title states, I'm trying to run gimp through a Node.js docker image.如标题所述,我正在尝试通过 Node.js docker 图像运行 gimp。 I have this working locally, however I get the following error trying to run gimp commands while it is being deployed on google cloud run:我在本地工作,但是在将 gimp 命令部署到 google cloud run 时尝试运行它时出现以下错误:

GIMP-Warning: The batch interpreter 'plug-in-script-fu-eval' is not available. Batch mode disabled.

The line of code that triggers this error:触发此错误的代码行:

exec('gimp --batch-interpreter plug-in-script-fu-eval -i --verbose -d -f -b 'MY COMMAND', {env:process.env})

The odd thing mostly being that it runs completely fine locally.最奇怪的是它在本地运行得很好。 My dockerfile:我的码头文件:

FROM debian:latest
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . .
RUN apt-get update 
RUN apt-get install -y gimp --no-install-recommends 
RUN apt-get install -y python
RUN rm -rf /var/lib/apt/lists/*
RUN apt-get update
RUN apt-get -qq install curl
RUN apt-get install -y aptitude
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - && apt-get install -y nodejs && aptitude install -y npm
RUN apt-get update
RUN npm install
EXPOSE 8080
CMD ["npm", "start"]

Any idea why it might work locally but not while being deployed?知道为什么它可以在本地工作但在部署时不能工作吗?

The fix was to change the cloud run container's Execution environment from "Default" to "Second Generation"解决方法是将云运行容器的执行环境从“默认”更改为“第二代”

If you don't specify an interpreter, Gimp uses the default interpreter (which is script-fu), and it works all the same:如果您不指定解释器,Gimp 将使用默认解释器(即 script-fu),它的工作原理是一样的:

root@a610863f4e50:~# gimp  -i --verbose -d -f -b '(gimp-message "Hello from container !!!!!!!!!!!!!!")' -b '(gimp-quit 0)'
Parsing '/etc/gimp/2.0/gimprc' for configured language.
Parsing '/root/.config/GIMP/2.10/gimprc' for configured language.
No language property found.
INIT: gimp_load_config
Parsing '/root/.config/GIMP/2.10/unitrc'
Parsing '/etc/gimp/2.0/gimprc'
Parsing '/root/.config/GIMP/2.10/gimprc'
INIT: gimp_initialize
INIT: gimp_real_initialize
Parsing '/usr/lib/gimp/2.0/interpreters/default.interp'
Parsing '/usr/lib/gimp/2.0/environ/default.env'
INIT: gimp_restore
Parsing '/root/.config/GIMP/2.10/parasiterc'
Parsing '/root/.config/GIMP/2.10/colorrc'
Parsing '/root/.config/GIMP/2.10/templaterc'
INIT: gimp_real_restore
Parsing '/root/.config/GIMP/2.10/pluginrc'
Querying plug-in: '/usr/lib/gimp/2.0/plug-ins/file-rawtherapee/file-rawtherapee'
Querying plug-in: '/usr/lib/gimp/2.0/plug-ins/file-darktable/file-darktable'
Initializing plug-in: '/usr/lib/gimp/2.0/plug-ins/file-rawtherapee/file-rawtherapee'
Initializing plug-in: '/usr/lib/gimp/2.0/plug-ins/file-darktable/file-darktable'
Writing '/root/.config/GIMP/2.10/pluginrc'
Starting extension: 'extension-script-fu'
No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
script-fu-Warning: Hello from container !!!!!!!!!!!!!!

batch command executed successfully
EXIT: gimp_exit
EXIT: gimp_real_exit
Terminating plug-in: '/usr/lib/gimp/2.0/plug-ins/script-fu/script-fu'
Terminating plug-in: '/usr/lib/gimp/2.0/plug-ins/script-fu/script-fu'
Writing '/root/.config/GIMP/2.10/colorrc'
Writing '/root/.config/GIMP/2.10/templaterc'
Writing '/root/.config/GIMP/2.10/parasiterc'
Writing '/root/.config/GIMP/2.10/unitrc'
EXIT: app_exit_after_callback

(by the way, --batch-interpreter plug-in-script-fu-eval doesn't work in the local container for me...) (顺便说一下, --batch-interpreter plug-in-script-fu-eval对我来说在本地容器中不起作用...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM