How can I add env host to CircleCi 2.0 Builds config

circle.yml
config

#1

Currently I am doing this:

  • run:
    name: update host file
    command: |
    echo 127.0.0.1 local.website.com | sudo tee -a /etc/hosts
    cat /etc/hosts

Does the 1.0 way still work?
https://circleci.com/docs/1.0/configuration/#hosts

If so, just wondering how do I know what 1.0 features will work on 2.0?


#2

No. You’re doing it correctly.

We are working to bridge the gap and documenting both new features and deprecated, older features.


#4

Hey I’m getting some weird errors when trying to run locally with the circleci CLI agent

/bin/bash: sudo: command not found
Error: Exited with code 127

Any idea ?


#5

Are you using docker? You cannot sudo inside of docker


#6