0

I need to set up a docker container with this:

https://github.com/bytedance/LatentSync/tree/main

and came up with this Dockerfile:

FROM ubuntu:latest
RUN apt-get update && apt-get install -y git
WORKDIR /app
RUN cd /app
RUN git clone https://github.com/bytedance/LatentSync.git
RUN cd LatentSync
RUN source setup_env.sh

However, when building this, I get an error:

=> ERROR [7/7] RUN source setup_env.sh                                                                                                                                0.1s 
------                                                                                                                                                                      
 > [7/7] RUN source setup_env.sh:
0.109 /bin/sh: 1: source: not found
------
Dockerfile:8
--------------------
   6 |     RUN git clone https://github.com/bytedance/LatentSync.git
   7 |     RUN cd LatentSync
   8 | >>> RUN source setup_env.sh
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c source setup_env.sh" did not complete successfully: exit code: 127

Why can't it find the source command?

2
  • Every RUN step is executed in a new shell. The cd and source steps do nothing because their change is lost as soon as the RUN step completes. Commented Jul 15 at 20:40
  • 1
    Because "RUN source command" is executed with "bash -c source command". You need to add a line "SHELL ["/bin/bash", "-c"]" so that "source command" can work Commented Jul 15 at 21:55

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.