Skip to content

Commit

Permalink
Requirements caching improvement + safer entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nusantara-self committed Feb 10, 2025
1 parent 4886aec commit 306d28d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ def build(dockerfile):
dockerfile_content = f"""
FROM {base}
{alpine_setup}WORKDIR /worker
COPY . {worker_name}
COPY requirements.txt {worker_name}/
RUN test ! -e {worker_name}/requirements.txt || pip install --no-cache-dir -r {worker_name}/requirements.txt
ENTRYPOINT {flavor["command"]}
COPY . {worker_name}/
ENTRYPOINT ["python", "{flavor['command']}"]
"""
print(f"Trying build for worker {worker_name} using base image {base}...")
with tempfile.NamedTemporaryFile() as f:
Expand Down Expand Up @@ -128,4 +131,4 @@ def correctly_pushed(self, namespace, repo, tag):
print(f"DEBUG: Comparing local_id and remote_id, local_id: {local_id}, remote_id: {remote_id}")
except NameError as e:
print(f"Error: {e}. Ensure 'local_id' and 'remote_id' are defined before comparing.")
return local_id == remote_id
return local_id == remote_id

0 comments on commit 306d28d

Please sign in to comment.