3

I am testing some Bitcoin related code and in order to test it have installed bitcoin-testnet-box within a docker container.

I use this guide: https://registry.hub.docker.com/u/freewil/bitcoin-testnet-box/

I pulled and run the docker without any problems.

BUT, I can not edit the bitcoin.conf files in their directories because I dont have an editor like NANO installed.

I would like to do:

sudo apt-get install nano

But it's not working. How can I fix that?

Cesare
  • 9,139
  • 16
  • 78
  • 130
user3335302
  • 37
  • 1
  • 4

3 Answers3

6

You can create your own Dockerfile to build on freewil/bitcoin-testnet-box

Dockerfile

FROM freewil/bitcoin-testnet-box
MAINTAINER dude
USER root
RUN apt-get update && apt-get install nano

In the directory with your Dockerfile run:

docker build -t "mybitcoinimage" .

and start the container

docker run -it mybitcoinimage /bin/bash

And you are in with root access and nano.

Bernardo Ramos
  • 4,048
  • 30
  • 28
christian
  • 9,412
  • 10
  • 41
  • 51
  • thanks, finally it worked, I created a file named "Dockerfile" as you recommended with those credentials. But building was only working by this command: **docker build - < Dockerfile** . And then with command: **docker images** I found the new volume. And I started it with: **docker run -it 7a0a14be2634** And the editor nano works perfect as well. – user3335302 Jan 18 '15 at 22:47
  • @user3335302 please accept the answer as a courtsey to people helping you. – eckes Sep 01 '16 at 19:52
2

It is best if you add the apt-get command to the Dockerfile and re-create the container. There are already RUN commands in there to show you how to do it.

You can also use docker run to execute a command. This could be apt-get. Besides, to inspect a running container, see here.

Community
  • 1
  • 1
eckes
  • 10,103
  • 1
  • 59
  • 71
  • I dont know how to do that... I run it by: docker run -t -i freewil/bitcoin-testnet-box do you mean I should run it by: docker run -t -i freewil/bitcoin-testnet-box apt-get install nano ?.. Because then i also get error – user3335302 Jan 18 '15 at 20:38
-3

Also for those of you who are interested:

I was only able to connect to the bitcoind from outside by running the docker with this command:

docker run -p 19001:19001 -it 7a0a14be2634 //7a.. is the volume))

then I can do a telnet to check if I can make a connection to bitcoind from another VM

telnet 192.168.142.163 19001

Now it finally works perfectly

user3335302
  • 37
  • 1
  • 4