1

I am able to run the hello world app:

sudo docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

I am now trying to run an app from docker-compose. I am new to this. In my directory I have Dockerfile and docker-compose.

Dockerfile:

FROM rocker/shiny-verse

COPY test_app mountpoints/apps/test_app

RUN apt-get update \
    && apt-get upgrade -y
    
WORKDIR test_app

EXPOSE 3838

CMD R --no-save -e 'shiny::runApp("app.R", port = 3838, host = "0.0.0.0")'

docker-compose:

version: "3.0"

services:
  test_app:
    container_name: test_app
    # To build the image locally, comment out "image" below, and uncomment
    # "build" and the lines indented under it.
    # image: rocker/shiny
    build:
      context: .
      dockerfile: Dockerfile
    restart: always
    # Setting this to something other than 'root' will cause shiny apps not to
    # run on the localhost:80 "Welcome to Shiny" diagnostics page mentioned
    # below.
    user: 'root'
    # Uncomment the lines below to disable application logs STDOUT output
    # environment:
    #   - APPLICATION_LOGS_TO_STDOUT=false
    ports:
      - '80:3838'
    #volumes:
      #- 'shiny_logs:/var/log/shiny-server'
      # Comment the line below out for initial testing. With it commented out,
      # going to localhost:80 in one's web browser will show a "Welcome to
      # Shiny Server!" diagnostics page.
      # - './mountpoints/apps:/srv/shiny-server'

Screen shot of my directory: enter image description here

I tried to run my app with docker-compose run test_app which results in:

ERROR: Couldn't connect to Docker daemon - you might need to run docker-machine start default.

I have iterated over every answer on this similar SO post.

No matter what I do I get the same message. I have tried reinstalling docker too. Same error message.

I'm on Ubuntu desktop 18.04. I'm not sure what other information to provide.

How can I run my app?

Doug Fir
  • 19,971
  • 47
  • 169
  • 299

0 Answers0