Sylar
Sylar

Reputation: 12092

Where is the workdir folders in Docker?

Im new to Docker and currently reading the docs as I go along. I also cant get my head around changing files in docker.

I've created a docker file on my local iMac:

Dockerfile:

from ubuntu:14.04

# Install prerequisites
run apt-get update && apt-get install -y \
    build-essential \
    cmake \
    curl \
    git \
    libcurl3-dev \
    libleptonica-dev \
    liblog4cplus-dev \
    libopencv-dev \
    libtesseract-dev \
    wget

# Copy all data
copy . /srv/openalpr


# Setup the build directory
run mkdir /srv/openalpr/src/build
workdir /srv/openalpr/src/build

# Setup the compile environment
run cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc .. && \
    make -j2 && \
    make install

workdir /data

entrypoint ["alpr"]

That file is inside a folder called "foo": foo/Dockerfile Inside foo folder, I'm expected to see this folder path: /srv/openalpr/src/build but I see nothing. What is and where is that folder? I thought ubuntu would be installed there? Basically I need to nano some files in x location inside ubuntu. Where and how to do that?

Upvotes: 0

Views: 2407

Answers (1)

mkasberg
mkasberg

Reputation: 17342

You seem to be under the impression that Docker creates an Ubuntu installation inside the folder foo. That's not quite right. The Docker environment is inside a "container" - think of it much like a virtual machine (while technically incorrect, it's a good way to think about it for now).

You should build your Dockerfile:

cd foo
docker build -t "Sylar/mydocker:latest" .

Then, to see the folder /srv/openalpr/..., you should get to a bash prompt inside the container. From there, you can cd and ls to look around:

docker run --rm -it Sylar/mydocker:latest /bin/bash

Upvotes: 2

Related Questions