Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove creation of directories in root while using docker (Close #5) #6

Merged
merged 4 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

# Install packages
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -yy -q software-properties-common
RUN add-apt-repository -y ppa:ubuntugis/ppa
RUN apt-get update
RUN apt-get install -yy -q libcurl4-gnutls-dev \
libssl-dev libproj-dev libgdal-dev gdal-bin python3-gdal \
libgdal-dev libudunits2-dev pkg-config libnlopt-dev libxml2-dev \
Expand All @@ -14,11 +12,24 @@ RUN apt-get install -yy -q libcurl4-gnutls-dev \
build-essential libspatialindex-dev python3-rtree
RUN apt-get install -yy -q wget unzip

# Directory
RUN mkdir starling_dir
WORKDIR /starling_dir

# Python packages
COPY requirements.txt .
RUN python3 -m pip install --upgrade pip
RUN pip3 install -r requirements.txt

# create a non-root user
# give them the password "user" put them in the sudo group
RUN useradd -d /home/starling_user -m -s /bin/bash starling_user \
&& echo "starling_user:starling_user" | chpasswd && adduser starling_user sudo

# Directory
RUN mkdir starling_dir
WORKDIR /starling_dir

# Make the files owned by user
RUN chown -R starling_user:starling_user /starling_dir

RUN apt-get -y install sudo

# Switch to your new user in the docker image
USER starling_user
3 changes: 3 additions & 0 deletions docs/run/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ You should then be able to use this image to create Docker containers
running the framework. Use the -v option to mount the Starling repository
in the container.

The Dockerfile create a new Linux user named 'starling_user'. If you need to use sudo,
the password is also 'starling_user'.

Detached mode
+++++++++++++

Expand Down