【问题标题】:Running sbt in a Docker Container在 Docker 容器中运行 sbt
【发布时间】:2021-12-03 05:58:36
【问题描述】:

我正在尝试为我的 scala 项目使用 Github 操作,并为它创建了一个 Docker 工作流。基本上,我正在尝试将 sbt 安装到我的容器中并运行该项目。

Dockerfile 看起来像这样:

FROM centos:centos8
ENV SCALA_VERSION 2.13.1
ENV SBT_VERSION 1.5.2

RUN yum install -y epel-release
RUN yum update -y && yum install -y wget

# INSTALL JAVA
RUN yum install -y java-11-openjdk

# INSTALL SBT
RUN wget http://dl.bintray.com/sbt/rpm/sbt-${SBT_VERSION}.rpm
RUN yum install -y sbt-${SBT_VERSION}.rpm

RUN wget -O /usr/local/bin/sbt-launch.jar http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/$SBT_VERSION/sbt-launch.jar

WORKDIR /root
EXPOSE 8080

RUN sbt compile
CMD sbt run

但是当我推送任何东西时,我会收到以下错误:

The command '/bin/sh -c wget http://dl.bintray.com/sbt/rpm/sbt-${SBT_VERSION}.rpm' returned a non-zero code: 8

当我手动检查链接时(通过设置 sbt 版本),我确实看到 bintray 响应 403 禁止错误,但 status.bintray.com 告诉所有系统都在运行。

我做错了什么还是 bintray 有什么问题?

【问题讨论】:

标签: scala docker sbt


【解决方案1】:

禁止并不意味着无法操作。 我认为该 url 不正确,因为它不是托管在 bintray 而不是 jfrog 上,请参阅 Centos 上的部分说明

删除旧的 Bintray repo 文件

https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html

【讨论】:

    猜你喜欢
    • 2018-04-29
    • 2022-01-09
    • 2020-07-21
    • 2017-01-30
    • 1970-01-01
    • 2022-10-04
    • 2015-03-05
    • 1970-01-01
    • 2020-02-09
    相关资源
    最近更新 更多