Steem Python SDK Docker Container Released

in #programming7 years ago

Steem SDK has been Dockerized!

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

Sort:  

Development wise, is yhere anything yo are looking for?

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.034
BTC 64058.80
ETH 3150.15
USDT 1.00
SBD 3.99