Introduction
When running a single server platform as daemon, you can view the logs with the. Do you need professional assistance with your tutor-managed Open edX. Instead, what you should probably do is to add your user to the “docker” group. On Docker for Mac OS, by default, containers are allocated at most 2 GB of RAM.
The suggested tool to support the autohoring of OpenStreetMap stylesheets developed in CartoCSS is Kosmtik, a software to produce, browse and verify raster tile maps based on pre-processors like CartoCSS and rendered through Mapnik.
Kosmtik is a node module needing a list of prerequisite software like PostgreSQL, PostGIS, Python, osm2pgsql and Node.js itself. Kosmtik also includes node versions of further software like Mapnik and Carto and at the moment it supports Ubuntu Linux. To simplify the related installation process, openstreetmap-carto comes with Docker files and documentation, which allow to build the image through simple commands.
Docker allows packaging applications and dependencies in virtual containers that can run on a host server without altering it permanently. The software components running within containers are easy to setup and tear down individually. This helps enable flexibility and portability. The Docker demon can use operating-system-level virtualization or a virtual machine. The Docker configuration included in openstreetmap-carto automates the setup of the Kosmtik development environment and simplifies the OSM data import process.
The openstreetmap-carto repository needs to be a directory that is shared between your host system and the Docker virtual machine. Home directories are shared by default; if your repository is in another place, you need to add this to the Docker sharing list.
Sufficient disk space of several gigabytes is generally needed. Docker creates an image for its virtual system that holds the virtualised operating system and the containers. The format (Docker.raw, Docker.qcow2, *.vhdx, etc.) depends on the host system. To provide a rough idea of the sizing, the physical size might start with 2-3 GB for the virtual OS and could grow to 6-7 GB when filled with the containers needed for the database, Kosmtik, and a small OSM region. Further 1-2 GB would be needed for shape files in the openstreetmap-carto/data repository.
The subsequently described step-by-step procedure allows installing and running a Docker image of Kosmtik with Ubuntu, with Windows and with macOS.
The Windows configuration exploiting Docker and Doker Toolbox is definitively a great tool to allow developing openstreetmap-carto with a 64 bit Windows PC and locally testing the style through Kosmtik on the same machine. With Docker Toolbox, Kosmtik is transparently run in a VirtualBox VM, with all development data (e.g., openstreetmap-carto directory) physically residing on the Windows host system and the PostGIS database (with imported OSM data) hosted within the VM.
The next paragraph describes the installation of Kosmtik with Ubuntu. The subsequent ones detail the steps to install Kosmtik with Windows and with macOS.
Ubuntu installation
For a standard Kosmtik installation without using Docker, check Installing Kosmtik and OpenStreetMap-Carto on Ubuntu.
To go on installing Docker, first update the system:
If on a brand new system you also want to do sudo apt-get dist-upgrade && sudo shutdown -r
.
Configure a swap.
The documentation in DOCKER.md describes how to run OpenStreetMap Carto with Docker. Check it before starting installation.
You need docker-compose, which can be installed from package through:
After logging out and logging back in, you can proceed to install openstreetmap-carto.
Otherwise follow the steps to install Docker on Ubuntu 18.04, 16.10, 16.04 or 14.04 (e.g., Docker CE) from the Docker site. Check alternatively the Docker installation script.
The lastest dev/test version of the Docker installation script can be downloaded and executed with the following command:
Then follow the post-installation steps from the Docker site. I.e:
Subsequently, perform the instructions to install Docker Compose from the Docker site. Alternatively, you could use the following command to grab the latest Docker Compose version from GitHub.
When successful, it shall return the actual installed version.
Install openstreetmap-carto:
Download a PBF of OSM data to the same directory where openstreetmap-carto has been downloaded, as mentioned in DOCKER.md. The downloaded file shall be named data.osm.pbf. E.g.:
For further information on the downloading of appropriate .osm or .pbf file, check “Get an OpenStreetMap data extract”.
Notice that, to maximize security, the default configuration denies remote access to Kosmitk and to the PostGIS DB, so the only valid addess by default is localhost (http://127.0.0.1:6789). In order to enable remote access to Kosmitk, before running docker-compose up
edit docker-compose.yml and change
to
Complete the installation and access the map from your browser. Run docker-compose:
The procedure takes many minutes to complete. Wait for kosmtik:1 [Core] Loading map
.
With your browser, access the map through http://ServerAddress:6789
To stop the database container:
Check also Recommendations and troubleshooting.
macOS installation
With macOS, Docker provides Docker for Mac and Docker Toolbox for Mac.
Docker for Mac is a native desktop application which requires OSX Yosemite 10.10.3 or above and new hardware models supporting MMU virtualization (i.e., Extended Page Tables (EPT) and Unrestricted Mode). Docker Toolbox allows the installation of Docker on older Macs that do not meet minimal system requirements for Docker for Mac.
Check the Docker installation pages for detailed installation requirements and procedures.
The setup procedure of Kosmtik with Docker for Mac is similar to the installation of Kosmtik with Ubuntu, while the setup of Kosmtik with Docker Toolbox for Mac is similar to the one with Windows.
The steps to add the openstreetmap-carto directory to the Docker sharing list are: Docker Preferences > File Sharing; Windows: Docker Settings > Shared Drives.
Importing the data needs a substantial amount of RAM in the virtual machine. If you find the import process (Reading in file: data.osm.pbf, Processing) being killed by the Docker demon, exiting with error code 137, increase the Memory assigned to Docker (e.g. Docker Preferences > Advanced > Adjust the computing resources).
Docker copies log files from the virtual machine into the host system, their location depends on the host OS. E.g. the ‘console-ring’ appears to be a ringbuffer of the console log, which can help to find reasons for killings.
While installing software in the containers and populating the database, the disk image of the virtual machine grows in size, by Docker allocating more clusters. When the disk on the host system is full (only a few MB remaining), Docker can appear stuck. Watch the system log files of your host system for failed allocations.
Docker stores its disk image by default in the home directories of the user. If you don’t have enough space here, you can move it elsewhere. (E.g. Docker > Preferences > Disk).1
Windows installation
Windows 10 64-bit allows installing Kosmtik and openstreetmap-carto via native Docker or Docker Toolbox.
With Windows, at the moment Docker can only be installed on 64-bit physical machines with hardware-assisted virtualization support enabled and where the operating system provides Hyper-V Host role (e.g., 64-bit Microsoft Windows 10 Professional/Enterprise/Education but not Windows 10 Home 64-bit, Windows 7 64-bit, etc.; anyway, Windows 10 Home can be upgraded to Win 10 Pro and this operation is relatively cheap).
For 64-bit Windows operating systems not natively supporting Docker, Docker Toolbox can be installed, which uses Oracle Virtual Box instead of Hyper-V. Neither Docker nor Docker Toolbox can be installed on a 32-bit architecture. Nested virtualization scenarios are not generally supported. Oracle Virtual Box would need a bare metal hw and should not be run inside a VM to support a 64 bit OS.
Kosmtik running through Docker Toolbox on a Windows 7 (or Windows 10 Home) takes about 2.8 GB in C:Users<user>.docker. It is advisable to use an i5 machine with 8 GB RAM at least.
Windows with Native Docker
This procedure allows installing and running a Docker image of Kosmtik with x64 Windows versions able to run native Docker.
Before starting, it is important to read the documentation in DOCKER.md
- Install Docker for Windows (enabling also the virtualization in the PC BIOS setting).
- Download openstreetmap-carto (at https://github.com/gravitystorm/openstreetmap-carto) to a local subdirectory of the user’s home directory (C:usersusername).
Digitech qp 6013 and windows 7 driver. Download a PBF of OSM data to the same directory where openstreetmap-carto has been downloaded, as mentioned in DOCKER.md. The downloaded file shall be named data.osm.pbf (example, download https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf and rename it as data.osm.pbf). For further information on the downloading of appropriate .osm or .pbf file, check “Get an OpenStreetMap data extract”.
Open a CMD prompt to this directory. Run docker-compose:
The procedure takes many minutes to complete. Wait for kosmtik:1 [Core] Loading map
.
Kosmtik can be run via browser pointing to
Windows with Docker Toolbox
The procedure here described allows installing and running a Docker image of Kosmtik with x64 Windows versions requiring Docker Toolbox.
Before starting, it is important to read the documentation in DOCKER.md
Install Docker Toolbox:
- Enable the virtualization in the PC BIOS setting
- Install the latest version of Oracle VM VirtualBox (this is advisable even if Docker Toolbox includes a recent version of this software)
- Install Docker Toolbox; select also the installation of “Git MSYS-git UNIX tools”.
- Run Docker Quickstart Terminal (All Programs, Docker, Docker Quickstart Terminal) and wait for the MINGW64 Console to start.
Notice that “Waiting for an IP…” takes the time needed to start a virtual machine named default and boot a Linux image included in a file named boot2docker.iso (automatically downloaded and configured by the software). The VM startup can take minutes.Within the login message before the UNIX prompt, the MINGW64 Console shall display the VM IP address (e.g., docker is configured to use the default mackine with IP 192.168.99.100
).A missing IP address means that the VM was not correctly created.An error like pywintypes.error: (2, 'WaitNamedPipe'..
means that the Docker Quickstart Terminal prompt has been started before the completion of the boot of the VM and without getting the IP address.
Download openstreetmap-carto to a local subdirectory of the user’s home directory (C:usersusername):
Download a PBF of OSM data to the same directory where openstreetmap-carto has been downloaded, as mentioned in DOCKER.md. The downloaded file shall be named data.osm.pbf. E.g.:
For further information on the downloading of appropriate .osm or .pbf file, check “Get an OpenStreetMap data extract”.
Complete the installation and access the map from your browser. Run docker-compose:
The procedure takes many minutes to complete. Wait for kosmtik:1 [Core] Loading map
.
Kosmtik can be run via a browser pointing to
The actual IP address can be found by running
or by running another Docker Quickstart Terminal, then reading the login message (docker is configured to use the default mackine with IP ..
).
The IP address range is set in the VM VirtualBox application: File, Preferences, Network tab, Host-only network tab, select the second adapter, DHCP Server tab.
The default VM can be safely stopped to release OS resources when not needed.
Each time Docker Quickstart Terminal is run, the VM is automatically restarted if in power-off state (but this takes its time to wait for the IP address…).
To start again the VM (alternatively to closing end reopening Docker Quickstart Terminal):
Wait for the VM to start, then issue:
To totally remove the docker installation, delete the virtual machine named default (docker-machine rm default
) and the directory C:Users<user>.docker.
While docker-compose up
is running, the openstreetmap-carto development can be directly done on the PC by accessing the local directory where openstreetmap-carto has been downloaded. E.g., locally editing a stylesheet and then pressing the Kosmtik Reload button on the browser, the map gets updated.
The RAM size available to the default VM should be increased for improved performance. To increase the VM memory size:
Change the memory of the default virtual machine though Oracle VM VirtualBox (and possibly also the number of cores).
Also, modify the .env
file as described at the Importing data section of the documentation. Then restart the project: close and restart Docker Quickstart Terminal (e.g., All Programs, Docker, Docker Quickstart Terminal); finally issue:
Recommendations and troubleshooting
To stop Kosmtik, select the window with docker-compose running and press Control C.
To start again Kosmtik without importing the OSM data:
To only import the OSM data saved in “data.osm.pbf” (also within a separate terminal while Kosmtik is running):
To import a PBF of OSM data with different name than data.osm.pbf (e.g., data1.pbf):
docker-compose up
does not update the shapefiles under the data subdirectory of openstreetmap-carto. To update them, issue the following command after positioning yourself in the openstreetmap-carto directory:
With Windows, this command can also be run locally through a Windows CMD (with Python installes), via scripts/get-shapefiles.py
.
Basic command to do the standard start-up:
Docker Toolbox for Windows
In case the docker-compose up
command reports the following error when using Docker Compose for Windows, check the directory where openstreetmap-carto has been installed:
It is suggested to position the openstreetmap-carto directory under the user’s home directory (C:usersusername). Alternatively, the drive where the project is located (i.e., where the Dockerfile and volume are located) shall be shared though Oracle VM VirtualBox. Runtime errors such as file not found, can’t open scripts or cannot start service may indicate shared drives are needed.
If, after restarting the PC or after hibernating and resuming a PC, at docker-compose up
, you get
or, if you get:
then issue the following:
subsequently, restart Docker Quickstart Terminal (e.g., All Programs, Docker, Docker Quickstart Terminal)
Additional recommendations for Docker Toolbox.
- Use direct internet access during the installation (without setting a proxy)
- Docker Toolbox needs to configure a Linux 64-bit VM. Set all virtualization features in the BIOS before running the Docker installation
- Do not manually start the interactive session of the VM VirtualBox used by Docker Toolbox (and named “default”) before running Docker Quickstart Terminal, but let this command start the VM; in case, close any Docker Quickstart Terminal, perform a
shutdown -h now
on the interactive session and wait for the VM to disappear. Then run Docker Quickstart Terminal. Notice that an error likepywintypes.error: (2, 'WaitNamedPipe'..
occurs when the Docker Quickstart Terminal is activated after a manual startup of the interactive session of the VM. docker-compose up
does not install or copy the openstreetmap-carto package itself on the VM and accesses the one manually downloaded to the PC.- Importing the data needs a substantial amount of RAM in the virtual machine. If you find the import process (Reading in file: data.osm.pbf, Processing) being killed by the Docker demon, exiting with error code 137, increase the Memory assigned to Docker (e.g. Docker Settings > Advanced > Adjust the computing resources).
Footnotes
推荐:【转】[容器-docker]Ubuntu 系列安装 Docker
64位系统的docker安装 http://dockerpool.com/static/books/docker_practice/install/ubuntu.html Ubuntu 系列安装 Docker 通过系统自带包安装 Ubuntu 14.04 版
2020腾讯云共同战“疫”,助力复工(优惠前所未有!4核8G,5M带宽 1684元/3年),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1054
2020阿里云最低价产品入口,含代金券(新老用户有优惠),
地址:https://www.aliyun.com/minisite/goods
I am running Ubuntu with the following docker software installed:
When trying to run docker-compose I am getting the following error:
I have tried the following:
Sudo?
When I run using sudo docker seems to be running:
How can I fix this?
ubuntudockerdocker-composethis questionedited Apr 29 '16 at 11:56 asked Apr 29 '16 at 10:53 Magick 439 6 29 Is the Docker daemon indeed running? What do you get when you execute
docker version
(that also lists the daemon version, i.e. more details than docker -v
)? – Rick Apr 29 '16 at 11:21 Can you verify that using systemctl
or whatever service manager you're using? – Rick Apr 29 '16 at 11:25 Seems like that makes this a duplicate of stackoverflow.com/q/33562109/2137833 – Rick Apr 29 '16 at 11:28 Possible duplicate of Can't connect to docker from docker-compose – Gangaraju Apr 29 '16 at 11:35 This is not a duplicate, as the other posts are using a different OS. Also, the proposed solutions did not solve this issue. – Magick Apr 29 '16 at 11:45 show more comments 1 Answers
1
Take a look a this thread. It seems to handle the same problem.
推荐:Docker学习笔记 — Docker安装(Ubuntu 64bit)
内核支持 如果我们使用的系统是14.04之前的版本,我们需要先升级内核。 $ sudo apt-get update$ sudo apt-get install linux-image-generic-lts-raring linux-h
Answers
:
The Docker machine is running. But you need to export some environment to connect to the Docker machine. By default, the docker CLI client is trying to communicate to the daemon using http+unix://var/run/docker.sock (as shown in the error message).
Export the correct environment variables using eval $(docker-machine env dev) and then try again. You can also just run docker-machine env dev to see the environment variables it will export. Notice that one of them is DOCKER_HOST, just as the error message suggests you may need to set.
this answer answered Apr 29 '16 at 11:03 Moerwald 859 1 2 21 I dont have docker-machine installed. Do I need to install machine? – Magick Apr 29 '16 at 11:16 1 Docker Machine is just a tool for managing multiple docker instances. You don't necessarily need it, but it was apparently being used in the linked thread. – Rick Apr 29 '16 at 11:22 try with sudo, that worked for me. – Viraths Dec 20 '16 at 11:03
推荐:在ubuntu14上面安装docker
注意此次是在ubuntu14上面安装的,如果是别的老版本可能需要安装一些依赖,具体看文: http://docs.docker.com/installation/ubuntulinux/ Installing Docker on
推荐:在ubuntu14上面安装docker
注意此次是在ubuntu14上面安装的,如果是别的老版本可能需要安装一些依赖,具体看文: http://docs.docker.com/installation/ubuntulinux/ Installing Docker on
- 1Docker学习笔记 — Docker安装(Ubuntu 64bit)
- 2Ubuntu下安装Docker并配置Tomacat和jdk.
- 3Ubuntu 14.04 64bit上使用IPython玩转Docker
- 4Ubuntu 16.04安装使用Docker版的GitLab
- 5实战:使用Docker配置ubuntu下的scrapy爬虫环境
- 1微信公众号文章采集,并发布到WordPress
- 2【转】[容器-docker]Ubuntu 系列安装 Docker
- 3在ubuntu14上面安装docker
- 4Docker学习笔记 — Docker安装(Ubuntu 64bit)
- 5ubuntu15.04下安装docker
- 6(OK) install-ubuntu-IMUNES-CORE-DOCKER
最新文章
- 1Docker 实战——将 JavaWeb 应用容器化
- 2每周荐书:云原生、Docker、Web算法(评论送书)
- 3微服务指南走北(五):什么样的服务才可以说是微服务?
- 4Ubuntu16.04安装Hadoop2.7.3教程
- 5WebRTC编译系统之gn和ninja
- 6Docker mesos在生产环境的应用