create account

Steem Python SDK Docker Container Released by iceshaft07

View this thread on: hive.blogpeakd.comecency.com
· @iceshaft07 ·
$1.43
Steem Python SDK Docker Container Released
# Steem SDK has been Dockerized!

![](https://steemitimages.com/DQmVwD69XoZLf1BkBAks8wt1Pg3EHcLxdNTLz9LD2zyziwc/image.png)

So I thought I would write a blog that would instruct users on how to install the Python Steem SDK. Installing this was a terrible, terrible process.

Take my word for it: *Don't Do It.*

For starters, the SDK doesn't work on Windows. But I didn't see any documentation anywhere saying that this was the case. I tried installing it. I also tried an enormous number of hacks to try to get it to work. This included copying linux C++ files into various locations on my Windows drive. Ultimately, this did not work.

I then tried installing it on Ubuntu. This was littered with problems too. One thing I learned, is that the Ubuntu Desktop requires Python 3.4.3. And if you try upgrading Python to version 3.5 or higher, you will break the Desktop. The menus will disappear, and you will very nearly frag your operating system to the point it needs to be reinstalled. Even then, after all the work arounds, your still working against the fact that your OS needs mutliple versions of Python installed. This ended up being a train wreck for me. I gave up and decided to go with Docker.

# It was a good decision to go with Docker.

After all the fighting with my operating systems, I finally got everything installed on Docker. But not just any Docker container. I got it installed on Alpine Linux for you. Alpine Linux is a super small operating system (5 MB) made for running production loads at minimum sizes. Docker is portable, so you can run it on Linux, Windows, or Mac.

So, rather then just getting a development environment ready for myself, I solved a major problem. Now, everybody has an easy way to develop. And, on top of that, it is a production-ready container. This container can be used on AWS's Elastic Beanstalk to provide fail-safe environments for you to run your code.

I'll show you how to do that later.

# Introducing... Steem Ship!
```
CHOO CHOO!

                ~~~ 
    o        s~~~
            ||    
   ____[]___||___
   \  o o o o o /
~~~~\__________/-x~~~~
  ~
                 ~
```

I have made the Docker Container readily available for your development and production loads. It is released under the M.I.T. license, so feel free to clone it and customize it as necessary.

Here is a copy of the docker container for your convenience:

```
# http://steem.readthedocs.io/en/latest/

FROM alpine:3.6

# This is a merge betwen the following repositories, 
# plus a few customizations
# https://github.com/frol/docker-alpine-python3
# https://github.com/frol/docker-alpine-gcc/blob/master/Dockerfile

# This will install Python 3 as well as the dependencies for steem
RUN apk add --no-cache python3 gcc musl-dev python3-dev openssl-dev && \
    python3 -m ensurepip && \
    rm -r /usr/lib/python*/ensurepip && \
    pip3 install --upgrade pip setuptools steem && \
    if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
    rm -r /root/.cache

ADD src/helloWorldExample.py /opt/script/helloWorldExample.py

ENTRYPOINT ["python3"]
CMD ["/opt/script/helloWorldExample.py"]
```
https://github.com/iceshaft07/steem-ship
👍  ,
properties (23)
authoriceshaft07
permlinksteem-python-sdk-docker-container-released
categoryprogramming
json_metadata{"tags":["programming","steem"],"image":["https://steemitimages.com/DQmVwD69XoZLf1BkBAks8wt1Pg3EHcLxdNTLz9LD2zyziwc/image.png"],"links":["https://github.com/iceshaft07/steem-ship"],"app":"steemit/0.1","format":"markdown"}
created2017-08-13 02:44:21
last_update2017-08-13 02:44:21
depth0
children3
last_payout2017-08-20 02:44:21
cashout_time1969-12-31 23:59:59
total_payout_value1.075 HBD
curator_payout_value0.356 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,183
author_reputation67,595,539,563
root_title"Steem Python SDK Docker Container Released"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id11,651,484
net_rshares436,163,365,721
author_curate_reward""
vote details (2)
@iceshaft07 ·
![steem-ship.png](https://steemitimages.com/DQmd1dQf2nWRQ7GxxUHXftwveTJyNcXpLZHHU8s6vGtUae6/steem-ship.png)
properties (22)
authoriceshaft07
permlinkre-iceshaft07-steem-python-sdk-docker-container-released-20170813t065725079z
categoryprogramming
json_metadata{"tags":["programming"],"image":["https://steemitimages.com/DQmd1dQf2nWRQ7GxxUHXftwveTJyNcXpLZHHU8s6vGtUae6/steem-ship.png"],"app":"steemit/0.1"}
created2017-08-13 06:57:24
last_update2017-08-13 06:57:24
depth1
children0
last_payout2017-08-20 06:57:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length107
author_reputation67,595,539,563
root_title"Steem Python SDK Docker Container Released"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id11,664,802
net_rshares0
@joeyarnoldvn ·
awesome
properties (22)
authorjoeyarnoldvn
permlinkre-iceshaft07-steem-python-sdk-docker-container-released-20170813t031028258z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2017-08-13 03:10:27
last_update2017-08-13 03:10:27
depth1
children1
last_payout2017-08-20 03:10:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation51,668,567,602,250
root_title"Steem Python SDK Docker Container Released"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id11,652,851
net_rshares0
@iceshaft07 ·
Development wise, is yhere anything yo are looking for?
properties (22)
authoriceshaft07
permlinkre-joeyarnoldvn-re-iceshaft07-steem-python-sdk-docker-container-released-20170813t032634842z
categoryprogramming
json_metadata{"tags":["programming"],"app":"steemit/0.1"}
created2017-08-13 03:26:36
last_update2017-08-13 03:26:36
depth2
children0
last_payout2017-08-20 03:26:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length55
author_reputation67,595,539,563
root_title"Steem Python SDK Docker Container Released"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id11,653,786
net_rshares0