-1

I can add lines on to a Makefile on a Mac terminal via echo command

But how can I edit a Dockerfile similarly?

The first line of the Dockerfile reads

FROM eosio/eos-dev:v1.2.4 

But since that docker repo is deprecated, I need to replace the first line with some other docker repo I found but I also want to create a shell script file that automatically does it.

I tried on the Mac terminal

echo 'FROM somerepo/somerepo-dev' >> Dockerfile 

but it doesn't do what I intend to do.

I tried a simple echo 'FROM somerepo/somerepo-dev' >> Dockerfile but it doesn't work.

FROM eosio/eos-dev:v1.2.4

replace the first line of the dockerfile with some other docker repo

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
user355843
  • 53
  • 1
  • 1
  • 8
  • See: [List of macOS text editors and code editors](https://stackoverflow.com/questions/20533/list-of-macos-text-editors-and-code-editors). – John Kugelman Oct 16 '19 at 01:06

1 Answers1

0

instead of using echo command on the terminal

sed -i -e 's/FROM eosio\/eos-dev:v1.2.4/FROM somerepo\/somerepo-dev/g' Dockerfile

solved the issue

there was no need to identify which line. I just have to specify everything within the line I wanted to replace

user355843
  • 53
  • 1
  • 1
  • 8