requirement:
code:
create a Dockerfile
this image will install python and start a SimpleHTTPServer:
FROM ubuntu ENV DEBIAN_FRONTEND noninteractive CMD ["bash"] RUN apt-get update RUN apt-get install -y python EXPOSE 8000 CMD python -m SimpleHTTPServer 8000
Build project
docker build -t myapp:latest .
run docker image
docker run -P myapp
-P for port forwarding: Publish all exposed ports to random ports
check the web page
find port by:
docker ps -l
This project can be found here:
https://github.com/guoliang-dev/docker-hello-world-python
Install / Start SSH in your guest Linux
sudo service ssh status
install open-ssh in case it’s not ready in your guest:
sudo apt-get install openssh-server
start the service if the service is stopped.
sudo service ssh start
Setup VirtualBox – port forwarding
virtualbox > edit settings for the guest vm:
network > port forwarding (e.g host 3022 -> guest 22)
SSH to the guest linux
ssh user@loalhost -p 3022
>python -m SimpleHTTPServer $PORT
After chunked uploading completed, commit the file by:
response = self.dropbox_client.commit_chunked_upload('/backup/docs.zip', upload_id, False) remote_path = response['path']
My understanding was remote_path in the response should be same as the full_path I passed: ‘/backup/docs.zip’, however, the remote_path is: ‘docs.zip’. form client.py /commit_chunked_upload:
The full path to which the chunks are uploaded, *including the file name*. If the destination folder does not yet exist, it will be created.
full path with filename, and it’ll be used by:
url, params, headers = self.request("/commit_chunked_upload/%s" % full_path, params, content_server=True)
a http request to : /commit_chunked_upload//backup/docs.zip will be sent. however, the actual server url is:
https://api-content.dropbox.com/1/commit_chunked_upload/auto/<path>
https://www.dropbox.com/developers/core/docs#commit-chunked-upload
1. fix the SDK :
Following CheckedUpload class, the commit url can be generated by:
path = “/commit_chunked_upload/%s%s” % (self.client.session.root, format_path(path))
2. add ‘auto’ in the front of the remote path:
response = self.dropbox_client.commit_chunked_upload('auto/' + remote_path, upload_id, False)
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.