2015-09-09 9 views
15

में आदेश नहीं मिला त्रुटि मैं सिर्फ मैं निम्नलिखित था मेरी टर्मिनल में एक बहुत ही सरल डोकर फ़ाइल बनाया है, मूल रूप से:apt-एड-भंडार: Dockerfile

mkdir pgrouted 
cd pgrouted 
touch Dockerfile 

अब मैं डोकर फ़ाइल नैनो संपादक में खोल और मैं डोकर फाइल करने के लिए निम्न कमांड जोड़ें:

FROM ubuntu 

MAINTAINER Gautam <[email protected]> 

LABEL Description="pgrouting excercise" Vendor="skanatek" Version="1.0" 

ENV BBOX="-122.8,45.4,-122.5,45.6" 

# Add pgRouting launchpad repository 
RUN sudo apt-add-repository -y ppa:ubuntugis/ppa 
RUN sudo apt-add-repository -y ppa:georepublic/pgrouting 
RUN sudo apt-get update 

# Install pgRouting package (for Ubuntu 14.04) 
RUN sudo apt-get install postgresql-9.3-pgrouting 

# Install osm2pgrouting package 
RUN sudo apt-get install osm2pgrouting 

# Install workshop material (optional, but maybe slightly outdated) 
RUN sudo apt-get install pgrouting-workshop 

# For workshops at conferences and events: 
# Download and install from http://trac.osgeo.org/osgeo/wiki/Live_GIS_Workshop_Install 
RUN wget --no-check-certificate https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting-workshop_2.0.6-ppa1_all.deb 

RUN sudo dpkg -i pgrouting-workshop_2.0.6-ppa1_all.deb 

# review:Not sure weather this should be in the dockerfile 
RUN cp -R /usr/share/pgrouting/workshop ~/Desktop/pgrouting-workshop 

# login as user "user" 
RUN psql -U postgres 

#create routing database 
RUN CREATE DATABASE routing; 

#add PostGIS functions 
RUN CREATE EXTENSION postgis; 

#add pgRouting core functions 
CREATE EXTENSION pgrouting; 

# Download using Overpass XAPI (larger extracts possible than with default OSM API) 
wget --progress=dot:mega -O "sampledata.osm" "http://www.overpass-api.de/api/xapi?*[bbox=${BBOX}][@meta]" 

पूरे Dockerfile एक नज़र में HERE देख जा सकता है।

अब जब मैं, dockerfile निर्माण करने के लिए तो जैसे प्रयास करें:

docker build -t gautam/pgrouted:v1 . 

dockerfile रन और की तुलना में मैं नीचे त्रुटि मिलती है:

Step 4 : RUN sudo apt-add-repository -y ppa:ubuntugis/ppa 
---> Running in c93c3c5fd5e8 
sudo: apt-add-repository: command not found 
The command '/bin/sh -c sudo apt-add-repository -y ppa:ubuntugis/ppa' returned a non-zero code: 1 

किसी मुझे बता सकते हैं क्यों मैं इस रही हूँ त्रुटि?

उत्तर

19

apt-add-repository बेस उबंटू छवि में नहीं है। आपको पहले इसे इंस्टॉल करने की आवश्यकता होगी। कोशिश apt-get install software-properties-common

वैसे, आप क्योंकि आदेशों जब तक आप USER कमांड के साथ किसी अन्य उपयोगकर्ता को बदलने के डिफ़ॉल्ट रूप से रूट के रूप में चलाने के Dockerfile में sudo उपयोग करने की आवश्यकता नहीं है।

+1

मैंने पहले 'रन पीटी-इंस्टाल सॉफ़्टवेयर-प्रॉपर्टी-कॉमन' कमांड के रूप में 'pt-get install सॉफ़्टवेयर-गुण-सामान्य' को जोड़ा था, जैसे, अब मुझे यह त्रुटि मिलती है http://chopapp.com/ # 8a4vdsnw –

+1

आपके उबंटू संस्करण के आधार पर, यह या तो 'पायथन-सॉफ्टवेयर-गुण' या 'सॉफ़्टवेयर-गुण-सामान्य' – user2915097

+1

हो सकता है ubuntu 16.04 पर यह 46 एमआईबी अतिरिक्त डेटा स्थापित करना चाहता है:/बहुत सरल निष्पादित करने में सक्षम होने के लिए बहुत कुछ आदेश। – cweiske

संबंधित मुद्दे