COPY失败:stat /var/lib/docker/tmp/docker-builderXXXXX/default.conf:没有这样的文件或目录

时间:2019-06-18 06:18:18

标签: docker hygieia

我正在尝试根据https://github.com/Hygieia/Hygieia

创建Hygieia api docker映像

所以我已经执行了卫生核心和卫生方面的"mvn clean install"。我现在正在尝试执行“ docker build。-t hygieia-api,但出现此错误:

  

复制失败:stat /var/lib/docker/tmp/docker-builderXXXXX/default.conf:没有此类文件或目录

有人可以阐明为什么会这样吗?我仍在尝试深入研究Docker的细节和过程,对此我将不胜感激。谢谢!

Dockerfile可以在这里找到 https://github.com/Hygieia/Hygieia/blob/master/Dockerfile

我尝试了一些建议的故障排除选项,例如重启docker服务或运行“ docker pull nginx”,但是我仍然遇到此错误。

FROM docker.io/nginx:latest

COPY default.conf /etc/nginx/conf.d/default.conf.templ
COPY conf-builder.sh /usr/bin/conf-builder.sh
COPY html /usr/share/nginx/html
RUN chown nginx:nginx /usr/share/nginx/html

EXPOSE 80 443

CMD conf-builder.sh &&\
  nginx -g "daemon off;"

1 个答案:

答案 0 :(得分:0)

首先,像这样运行:

  <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/mainLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                android:id="@+id/textView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="@string/my_images_gallary"
                android:textSize="36sp"
                android:textStyle="bold" />

            <ListView
                android:id="@+id/listView"
                android:layout_width="match_parent"
                android:layout_height="0dp">

            </ListView>

            <Button
                android:id="@+id/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="150dp"
                android:text="Button" />
        </LinearLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>
[Output for the height is 0dp][1]
and if i use the ListView Height as match_parent so the bottom button will not appear.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/mainLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:id="@+id/textView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/my_images_gallary"
            android:textSize="36sp"
            android:textStyle="bold" />

        <ListView
            android:id="@+id/listView"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </ListView>

        <Button
            android:id="@+id/button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="150dp"
            android:text="Button" />
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

第二,您的default.conf必须与dockerfile位于同一目录。

第三,从dockerfile的最后一个字符串中删除所有空格

相关问题