Im trying to build a docker image and get:
ERROR: failed to solve: cannot replace to directory /home/user/.local/share/docker/overlay2/4x9idkq31iucxi4u45xhi7wqp/merged/bin with file
This happens when i am trying to copy.
COPY --from=builder / /
The same docker file build and run on my machine but on another machine it doesn't.
My machines docker version: Docker version 20.10.12, build e91ed57 Other machine: Docker version 23.0.6, build ef23cbc
Any idea on how to fix this issue. Thank you.
I pruned the docker system and restarted the docker engine. Tried rebuilding but problem persisted.
EDIT: Adding a snipper of the dockerfile contents to reproduce the problem:
FROM ubuntu:focal as base
FROM base as builder
# Install dependencies
RUN DEBIAN_FRONTEND=export LANG=en_US.UTF-8
# RUN DEBIAN_FRONTEND=locale-gen "en_US.UTF-8"
RUN DEBIAN_FRONTEND=export PATH="$HOME/.local/bin:${PATH}"
# RUN DEBIAN_FRONTEND=set -eux
RUN rm -rf /var/lib/apt/lists/*
FROM python:3.8.3-slim
RUN mkdir /install
WORKDIR /install
RUN apt-get update && \
apt-get install build-essential libffi-dev -y && \
python -m ensurepip && \
pip install --upgrade pip
COPY requirements.txt ./
RUN pip install setuptools wheel && python -m pip install --no-cache-dir --upgrade pip setuptools
ENV PYTHONPATH /usr/local/lib/python3.8/site-packages
RUN pip install -r requirements.txt
RUN apt-get update && apt-get upgrade -y
COPY --from=builder / /
COPYcommand is trying to overwrite the entire container filesystem, and that's unlikely to work well; you can run into hard-to-debug issues around shared libraries and other sorts of conflicts./binand the shared libraries in/usr/libwill get overwritten with possibly-incompatible things. What do you want this line to actually do?