Docker Community Forums

Share and learn in the Docker community.

Docker image with working diretory?


(Swemattias) #1

I am newbie to docker, 16 hours in, with months playing around with LXD/LXC.
So it was not hard to convert the knowledge.
I am running an both macOS and Ubuntu server 18.10.

Mainly on macOS, atm I am trying to setup an developer image, I install an webserver and a handfull of javascript frameworks. WIth that I’d like to have a wokring directory.
With that I mean I change something inside the folder and when I reload the page wthey should be visisble.

I have tried this:
docker run -p 8800:80 -d -v ~/dev/docker/sailweb/app/:/var/www/html/app,rw --name sailweb sailweb

I got a suggestion to do in docker compose instead and so I did:

version: ‘3’

services:
web:
build: .
ports:
- “80:8080”
volumes:
- ~/Utveckling/docker/sail/app/:/var/www/html/app
working_dir: /var/www/html/app

But the key function isnt working, no matter what I do in the app directory nothing reflects what the web server shows me.
How do

I am runng docker 18.09 on macOS 10.14 and Ubuntu Server 18.10.