Error mapping file into docker container

Specifically, for Docker on Windows, Virtualbox version, in conjunction with WSL. When I run ‘docker-compose up’, I get this error

ERROR: for 125f20ccead0_lempr_web_1 Cannot start service web: OCI runtime create failed: container_linux.go:348: starting container process caused “process_linux.go:402: container init caused \”rootfs_linux.go:58: mounting \\\”/d/Code/lempr/web/nginx.conf\\\” to rootfs \\\”/mnt/sda1/var/lib/docker/aufs/mnt/065f6aacb3ee01072637ae0544f50a9b772df662ea8e7e3dc2d663d87d7e1a4f\\\” at \\\”/mnt/sda1/var/lib/docker/aufs/mnt/065f6aacb3ee01072637ae0544f50a9b772df662ea8e7e3dc2d663d87d7e1a4f/etc/nginx/nginx.conf\\\” caused \\\”not a directory\\\”\””: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

I checked to make sure nginx.conf exist both outside and inside the container.

Then I tried to map the file to a different location, it gets created as a directory inside the container!

I tried various suggestions from the internet:

  • Restart the host machine
  • Map /mnt/c to /c
  • Share the /c drive to the docker-machine VM inside virtual box
    • To do so, open virtualbox
    • Select the ‘default’ machine
    • Go to settings
    • Go to ‘shared folders’
    • Click add
    • Add C and D as shares
    • Attach a console to the machine to make sure the share works

To no avail. Meanwhile the same docker-compose works just fine on my Mac.

So I concluded WSL mapping and docker for Windows’ mapping can’t handle this use case at all and I should switch to a *nix OS for the task.

Windows seems to be unable to handle this setup

Docker-Machine (in Virtualbox) -> Windows -> WSL

It seems there’s a problem with mapping paths from the docker-compose VM to Windows, not a problem with WSL, since trying within Docker’s MINGW command line yields the same result as WSL’s.

 

Review of VPS hosts in Korea

Popular providers like DO, Linode and Vultr all have presence in Japan… but not in Korea, the country with the fastest internet connection on the planet, which is a shame.

And due to the language barrier, it’s pretty hard to find info on Korea-hosted VPS on the internet. This post aims to solve that

Straight to the point –

Cafe24

Probably the most popular host in Korea. They host websites, wordpress installation, bare metal server and of course… VPS. Here’s the price

Starting from $5.5 for 1GB RAM to 33$ for 4GB RAM, per month

Pros

  • You get 8 cores regardless of the plan
  • VMWare Virtualization
  • One dedicated IPv4 address
  • The best price you’ll get of any reputable provider
  • Select between Linux / Windows (costs more)
  • Pretty fast disk (twice as fast as Vultr)

Cons

  • Setup fee 22$
  • Pretty limited bandwith, 300GB per month at the worst case
  • Crappy CPU, the cores are really slow (I think they are second-gen Xeons), with most of the CPU extensions disabled… so they are only good for one thing: serving web pages (and no, they can’t do THAT thing you are thinking about when you read “8 cores” 😉
  • Of course you must speak Korean to register or contact support
  • Require a Korean ID

You can register for them here

Somagu (mud fish)

Cheapest provider I could find that have servers in Korea. Pretty simple interface. Prices

Starting at $2.57 permonth for 512GB RAM

Pros

  • Korean hosted
  • English support
  • Automatic activation
  • Cheapest of anything you can find in Korea
  • Don’t require a Korean ID

Cons

  • You get to share IP
  • Your shared IP is used by Chinese spammers… you’ll see a lot of IP change request in the support forum. I don’t know why but for some reason Chinese spammers love themselves a Korean address

You can find them here

iwinv

Price

From $4 per month for 1 core / 1GB RAM

Pros

  • Cheap
  • Free IP

Cons

  • Korean only
  • Requires Korean ID
  • Limited bandwidth

You can find them here

Amazon lightsail (Seoul region)

Available countries

Recently made available in Seoul, cheaper than EC2, a good choice if you are already tied into the Amazon ecosystem

Price starting from 5$ for 512MB RAM

Pro

  • Reputable
  • Easy to use
  • All in English
  • Don’t require a Korean ID
  • Generous bandwidth

Cons

  • More expensive compared to other options

Find ’em here

Amazon EC 2

Pro

  • Like lightsail
  • Much more versatile

Cons

  • Way way too expensive, unless you are a corporate user

You know where to find them

PHP school

Starting from 4,900 won for 512MB RAM

Cons

  • Pretty slow… can’t open their homepage at the time of writing

Find them here

Naver cloud

Starting from $13 for 1GB RAM

Pros

  • English support
  • Reputable company
  • No bandwidth limit

Cons

  • Expensive like EC2

You can find them here

First glance onto distributed computing

A recent post on the computer science blog about distributed database management systems fired up the curiosity in me on distributed computing again.

Even though I have attended the parallel computing course while I was still a student, I have always thought cloud computing as worked by some sort of magic :P. I learned how I can distribute parts of a problem but I don’t understand how a single infrastructure (the cloud), can solve many problems thrown at it and balancing between them but not let them interfere with each other, and all that with no special modification to the hardware in the while.

Also contributed in part to my confusion is perhaps the name of the course, “parallel”, which reflects in my brain as a pair of something going on together. The truth is, parallel means asynchronously, many things can get done at the same time.

Well, there’s no magic after all, it’s our common perception about programming that is bended by our habit. After reading about MapReduce and watching a lecture from Google Code University, I finally get it.

There is no data types, there’s just data!

Similar to what I’ve learned, distributed computing is about “diving and conquer” problems. You’ll have to acquire quantization skills to break down complex problems in to simpler problems with which the two core function can work with:

  • Map (to process and break something in to smaller things). At the core of map, there’s some sort a halt condition to be executed when the problem can’t be broken smaller anymore.

Map is processing green stuff and creates red stuff (illustration courtesy of the University of Washington)

  • Reduce (to combine multiple small things to more usable things).

"Reduce" is combining red stuff and green stuff to produce some result

But these two function alone is not enough. How would different type of data treated when there’s no concept of type? The answer is, you make function that take data and return data but process them in a specific way.

Take the example mentioned in the Google lecture above, to process characters in a string, a bunch of data that represent a string (but is not a string since we have no typing system here) is passed into a function called explode, which will return some data that represent characters. And if the processing is to return a string in the end, a function called implode will be needed. This function do the reverse, take data that represent character and strings and return data that represent strings.

By solving the data typing and transitioning, the above paradigm of distributed computing paved way for cloud computing: while distributed computing systems is built to solve a single, specific problems with steps well-defined when the system is constructed. Cloud computing, on the other hand, is simple a collection of the most primitive functions described above, leaving the decision of how to use them to the developer.

So the good news is, developers will still have much to do creating and maintaining cloud systems, and they should be simpler to maintain. But the bad news is, our perception of data will need to renew itself to prepare for the future.