HelloWorld Apama Docker 应用程序
HelloWorld Apama Docker Application
我正在尝试使用 apama-builder 构建一个简单的 HelloWorld docker 图像。但是我收到以下错误:
INFO: copying the project file from /app/HelloWorld to output directory /app/deployed
ERROR: Failed to create correlator initialization list: /app/deployed
The command '/bin/sh -c engine_deploy --outputDeployDir /app/deployed /app/HelloWorld' returned a non-zero code: 100
我的 Docker 文件如下所示:
# Use the build environment
FROM store/softwareag/apama-builder:10.3 as builder
# Copy project assets into build environment
COPY --chown=1724:1724 . /app/HelloWorld
# Deploy the apama project
RUN engine_deploy --outputDeployDir /app/deployed /app/HelloWorld
# Add any additional build steps you may have, such as building plugins, here
# RUN ...
# Final image is based on the runtime base image
FROM store/softwareag/apama-correlator:10.3
# Copy deployed project from the build environment
COPY --chown=1724:1724 --from=builder /app/deployed /app/deployed
# Add copies for any additional build artifacts created in the build environment
# COPY --from=builder ...
WORKDIR /app
# Run the deployed project
CMD ["correlator", "--config", "Project_deployed", "--logfile", "/dev/stdout"]
注意我使用的是 CentOS,我的 HelloWorld 应用程序位于 /app/HelloWorld,我希望输出位于 /app/deployed。
有几个问题,但这是因为部署过程不是 运行 root 用户,因此无法创建输出目录。它最初也愚弄了我 :)
首先是
# Copy project assets into build environment
COPY --chown=1724:1724 . /app/HelloWorld
有效,但 engine_deploy 无效,因为它无法访问 /app/deployed
因此,如果您将 engine_deploy 行更改为
RUN engine_deploy --outputDeployDir ${APAMA_WORK}/deployed /app/HelloWorld
它通常会在 "work" 目录中创建 运行 可用的应用程序部署 /apama_work
现在因为它不在您放置它的位置,所以您需要从构建器更改副本
# Copy deployed project from the build environment
COPY --chown=1724:1724 --from=builder ${APAMA_WORK}/deployed ${APAMA_WORK}/deployed
最后 CMD 行需要更改
# Run the deployed project
CMD ["correlator", "--config", "deployed", "--logfile", "/dev/stdout"]
匹配输出目录
我正在尝试使用 apama-builder 构建一个简单的 HelloWorld docker 图像。但是我收到以下错误:
INFO: copying the project file from /app/HelloWorld to output directory /app/deployed
ERROR: Failed to create correlator initialization list: /app/deployed
The command '/bin/sh -c engine_deploy --outputDeployDir /app/deployed /app/HelloWorld' returned a non-zero code: 100
我的 Docker 文件如下所示:
# Use the build environment
FROM store/softwareag/apama-builder:10.3 as builder
# Copy project assets into build environment
COPY --chown=1724:1724 . /app/HelloWorld
# Deploy the apama project
RUN engine_deploy --outputDeployDir /app/deployed /app/HelloWorld
# Add any additional build steps you may have, such as building plugins, here
# RUN ...
# Final image is based on the runtime base image
FROM store/softwareag/apama-correlator:10.3
# Copy deployed project from the build environment
COPY --chown=1724:1724 --from=builder /app/deployed /app/deployed
# Add copies for any additional build artifacts created in the build environment
# COPY --from=builder ...
WORKDIR /app
# Run the deployed project
CMD ["correlator", "--config", "Project_deployed", "--logfile", "/dev/stdout"]
注意我使用的是 CentOS,我的 HelloWorld 应用程序位于 /app/HelloWorld,我希望输出位于 /app/deployed。
有几个问题,但这是因为部署过程不是 运行 root 用户,因此无法创建输出目录。它最初也愚弄了我 :)
首先是
# Copy project assets into build environment
COPY --chown=1724:1724 . /app/HelloWorld
有效,但 engine_deploy 无效,因为它无法访问 /app/deployed
因此,如果您将 engine_deploy 行更改为
RUN engine_deploy --outputDeployDir ${APAMA_WORK}/deployed /app/HelloWorld
它通常会在 "work" 目录中创建 运行 可用的应用程序部署 /apama_work
现在因为它不在您放置它的位置,所以您需要从构建器更改副本
# Copy deployed project from the build environment
COPY --chown=1724:1724 --from=builder ${APAMA_WORK}/deployed ${APAMA_WORK}/deployed
最后 CMD 行需要更改
# Run the deployed project
CMD ["correlator", "--config", "deployed", "--logfile", "/dev/stdout"]
匹配输出目录