### Bug description

## Bug Description

While running quarto preview from within a Docker container on my M1 Mac, I am not served a localhost URL for the preview. Here is my output which *appears* to run fine. 

```
$ quarto preview index.qmd
pandoc
  to: html
  output-file: index.html
  standalone: true
  title-prefix: EDoN Secure Research Environment Wiki
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png
  css:
    - styles.css
  toc: false

metadata
  pagetitle: EDoN Secure Research Environment Wiki
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  theme:
    - sandstone
    - custom.scss
```
But as mentioned I was expecting a localhost URL output in the terminal.

*Note* everything is fine when running on my M1 Mac locally. 

and here is my Dockerfile:

```dockerfile
FROM rocker/r-ver:4.2.1

RUN apt-get update
RUN apt-get install -y --no-install-recommends libxt6
RUN apt-get install nano
RUN apt-get install -y libxml2 libodbc1

ENV S6_VERSION=v2.1.0.2
ENV RSTUDIO_VERSION=2022.07.2+576
ENV DEFAULT_USER=rstudio
ENV PANDOC_VERSION=default
ENV QUARTO_VERSION=1.2.269

RUN /rocker_scripts/install_rstudio.sh
RUN /rocker_scripts/install_pandoc.sh
RUN /rocker_scripts/install_quarto.sh
RUN quarto install extension --no-prompt quarto-ext/grouped-tabsets

RUN useradd -u 1001 -g rstudio -m conda
RUN useradd -u 504 -g rstudio -m mac
USER conda

WORKDIR /home/conda

ENV PATH="/home/conda/miniconda3/bin:${PATH}"
ARG PATH="/home/conda/miniconda3/bin:${PATH}"
ENV MLFLOW_BIN=/home/conda/miniconda3/bin/mlflow
ENV MLFLOW_PYTHON_BIN=/home/conda/miniconda3/bin/python

RUN wget \
    https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
    && bash Miniconda3-latest-Linux-x86_64.sh -b \
    && rm -f Miniconda3-latest-Linux-x86_64.sh
RUN conda --version

USER root

RUN R -q -e 'install.packages(c("reticulate","vetiver","pins","dplyr","checkmate","quarto","gt","tidymodels","randomForest","tidyverse","lcmm"))'
ENV PATH "$PATH:/root/.local/share/r-miniconda/bin"
RUN R -q -e 'reticulate::py_install(envname="base",c("vetiver","pins","scikit-learn","pandas","nbformat","nbclient"),pip=TRUE)'
ENV USER="rstudio"

CMD ["/usr/lib/rstudio-server/bin/rserver", "--server-daemonize", "0", "--auth-none", "1"]

EXPOSE 8787

CMD ["/init"]
```

I have also tried manually specifiy the port in the_quarto.yml file, but I get a "refused to connect" error when opening `http://localhost/4200` in my browser.

```
project:
  type: website
  output-dir: docs
  preview:
    port: 4200
    browser: false
  resources:
    - "get-started/new-cars.csv"
  render:
    - about.qmd
    - index.qmd
    - learn-more/*
    - get-started/index.qmd
    - get-started/version.qmd
    - get-started/monitor.qmd
    - learn-more/containers.qmd
```

## Steps to reproduce

```
git clone https://gitlab.com/arronlacey/r_miniconda_container.git
cd r_miniconda_container
git pull registry.gitlab.com/arronlacey/r_miniconda_container
docker run --rm -p 8787:8787 -v ${PWD}:/mnt registry.gitlab.com/arronlacey/r_miniconda_container
docker exec -it <image name> /bin.bash
cd /mnt
quarto preview index.qmd
```

## System info 

macOS Monterey 12.5.1
quarto 1.2.269

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
2022-11-16T11:46:48Z
arronlacey
bug needs-repro third-party
closed
quarto fails to preview from inside a docker image that is running on M1 Mac
https://github.com/quarto-dev/quarto-cli/issues/3346