我正在尝试将 Duckling 服务器部署到 AWS EC2 容器。在将容器推送到 AWS 上的 ECR 之前,我一直在尝试在本地构建容器。
当我在本地构建和标记容器时,我遇到以下错误:
> [builder 9/9] RUN stack install:
#16 0.937 Error parsing targets: The project contains no local packages (packages not marked with 'extra-dep')
这是我正在使用的 Dockerfile:
FROM haskell:8-buster AS builder
RUN apt-get update -qq && \
apt-get install -qq -y libpcre3 libpcre3-dev build-essential --fix-missing --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir /log
WORKDIR /duckling
ADD . .
ENV LANG=C.UTF-8
RUN stack init
RUN stack setup
ADD . .
# NOTE:`stack build` will use as many cores as are available to build
# in parallel. However, this can cause OOM issues as the linking step
# in GHC can be expensive. If the build fails, try specifying the
# '-j1' flag to force the build to run sequentially.
RUN stack install
FROM debian:buster
ENV LANG C.UTF-8
RUN apt-get update -qq && \
apt-get install -qq -y libpcre3 libgmp10 --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=builder /root/.local/bin/duckling-example-exe /usr/local/bin/
EXPOSE 8000
CMD ["duckling-example-exe", "-p", "8000"]
关于我在这里做错了什么的任何想法,或者是否有另一种方法将服务器部署到 AWS 上?
谢谢