Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Wrong Dockerfile configuration on Deploy Streamlit using Docker docs page

Aperta
#968 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
55/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
docker, python

Direzione di ricerca

Apri la pagina «Deploy Streamlit using Docker» ed esamina l’esempio di Dockerfile relativo a WORKDIR, git clone e pip3 install. Esegui la build dell’esempio documentato per confermare il problema segnalato e verificare che le istruzioni pubblicate vengano completate correttamente con la directory di lavoro prevista.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Checklist
  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.
Summary

Hey

Today by following the manual at Deploy Streamlit using Docker (https://docs.streamlit.io/knowledge-base/tutorials/deploy/docker) I run into the problem of setting a WORKDIR for the Docker.

The WORKDIR has to be moved after the RUN git clone method for the Docker to set the WORKDIR correctly. Otherwise, it results in Docker being unable to set the WORKDIR and default to running the commands in its directory.

This way the docker build fails at RUN pip3 install -r requirements.txt

Wrong version:

# app/Dockerfile

FROM python:3.9-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/streamlit/streamlit-example.git .

RUN pip3 install -r requirements.txt

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]

Corrected version:

# app/Dockerfile

FROM python:3.9-slim

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/streamlit/streamlit-example.git .

WORKDIR /app

RUN pip3 install -r requirements.txt

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]

ran

Reproducible Code Example

No response

Steps To Reproduce

No response

Expected Behavior

No response

Current Behavior

No response

Is this a regression?
  • Yes, this used to work in a previous version.
Debug info
  • Streamlit version:
  • Python version:
  • Operating System:
  • Browser:
Additional Information

No response

Lingua principale
JavaScript
Stelle
178
Fork
708
Merge medio
1g 12h
PR unite (30g)
12

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di streamlit/docs

Tutte le issue di streamlit/docs

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.