Running the Tweet Gathering container

To run the Tweet Gathering application is slightly different. This container needs environment variables which are used to interact with the Twitter API. We can use the -e argument on the docker run command. Let's do that:

docker run -d --name gathering --net twitter -e CONSUMER_KEY=gupfxwn43NBTdxCD3Tsf1JgMu \-e CONSUMER_SECRET=pH4uM5LlYxKzfJ7huYRwFbaFXn7ooK01LmqCP69QV9a9kZrHw5 \-e ACCESS_TOKEN=940015005860290560-m0WwSyxGvp5ufff9KW2zm5LGXLaFLov \-e ACCESS_TOKEN_SECRET=KSofGB8aIwDmewceKXLbN8d5chvZkZyB31VZa09pNBhLo \-p 8081:8081 springfivebyexample/tweet_gathering

Take a look at the environment variables we have configured in the application.yaml file. The Docker run command will inject these variables ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.