I would also recommend using the docker image from docker-hub.
Pull it by running the following command:
docker pull eosio/eos-dev
Now you create a folder in your local machine named Code
Afterwards you can start the container by running it with the following command. This will use your local Code folder and mount it to the filesystem in the docker container.
docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v <path_to_code>/Code:/Code -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console"
Afterwards you use aliases for calling cleos and eosiocpp.
alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'
alias eosiocpp='docker exec eosio /opt/eosio/bin/eosiocpp'
Now you can start developing and if you want to compile your code you can call the eosiocpp alias with your mycontract.cpp file.
eosiocpp -o Code/mycontract.wast Code/mycontract.cpp
eosiocpp -g Code/mycontract.abi Code/mycontract.cpp
Pushing it to the chain can be done by using cleos alias with:
cleos set contract mycontract Code/mycontract Code/mycontract.wast Code/mycontract.abi
For debugging the container this might also help. Which gives you a terminal inside the container.
docker exec -i -t eosio /bin/bash
And viewing logs with:
docker logs --tail 100 eosio