Hello,
I am very new to Docker so I apologize if this is somewhat an obvious issue to resolve. I am trying to create a Docker container for an R Shiny app
This is my Docker file I use to build my image:
FROM --platform=linux/amd64 bioconductor/bioconductor_docker:RELEASE_3_19-R-4.4.1
RUN R -e "BiocManager::install(c('ComplexHeatmap','GenomicRanges','GenomeInfoDb','IRanges','rhdf5','Rsamtools','S4Vectors','slingshot','SingleCellExperiment'),update=FALSE)"
RUN R -e "install.packages(pkgs=c('shiny','tidyverse','shinydashboard','xgboost','DT','plotly','tidymodels','ggridges','tidytext','bibtex','bslib','circlize','colourpicker','data.table','DBI','DT','fs','ggdendro','ggforce','ggplot2','ggrepel','ggridges','gridExtra','htmltools','jsonlite','Matrix','magrittr','plotly','RColorBrewer','RefManageR','RSQLite','scales','scrypt','Seurat','SeuratObject','shinyhelper','shinymanager','sortable','xml2','grDevices','grid','methods','patchwork','stats','tools','xfun','utils','svDialogs','shinyalert'), repos='https://cran.rstudio.com/')"
RUN mkdir /root/app
COPY R /root/shiny_save
EXPOSE 3838
CMD ["R", "-e", "shiny::runApp('/root/shiny_save', host='0.0.0.0', port=3838)"]
I build my Docker image using the following line:
docker build -t ufc-app .
I, then, run my Docker using the line:
docker run -d --rm -p 3838:3838 ufc-app
Using Docker Desktop, I get the following output:
2025-04-04 09:35:31
2025-04-04 09:35:31 R version 4.4.1 (2024-06-14) -- "Race for Your Life"
2025-04-04 09:35:31 Copyright (C) 2024 The R Foundation for Statistical Computing
2025-04-04 09:35:31 Platform: x86_64-pc-linux-gnu
2025-04-04 09:35:31
2025-04-04 09:35:31 R is free software and comes with ABSOLUTELY NO WARRANTY.
2025-04-04 09:35:31 You are welcome to redistribute it under certain conditions.
2025-04-04 09:35:31 Type 'license()' or 'licence()' for distribution details.
2025-04-04 09:35:31
2025-04-04 09:35:31 Natural language support but running in an English locale
2025-04-04 09:35:31
2025-04-04 09:35:31 R is a collaborative project with many contributors.
2025-04-04 09:35:31 Type 'contributors()' for more information and
2025-04-04 09:35:31 'citation()' on how to cite R or R packages in publications.
2025-04-04 09:35:31
2025-04-04 09:35:31 Type 'demo()' for some demos, 'help()' for on-line help, or
2025-04-04 09:35:31 'help.start()' for an HTML browser interface to help.
2025-04-04 09:35:31 Type 'q()' to quit R.
2025-04-04 09:35:31
2025-04-04 09:35:32 > shiny::runApp('/root/shiny_save', host='0.0.0.0', port=3838)
2025-04-04 09:35:32 Loading required package: shiny
2025-04-04 09:35:52
2025-04-04 09:35:52 Listening on http://0.0.0.0:3838
When I try to access http://0.0.0.0:3838 using a browser, I get the error: " This site can’t be reached. The webpage at http://0.0.0.0:3838/ might be temporarily down or it may have moved permanently to a new web address."
I am very new to Docker and I am unsure if I am messing something with my Docker set up or if this is potentially a Firewall issue? I would appreciate any assistance here.