Learn to use Docker in Development - Part 1

preview_player
Показать описание

Learn how to use docker images & containers to create a multi-part Ruby on Rails development environment.

-~-~~-~~~-~~-~-
Please watch: "How to Write Better Automated Tests"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

If you're following along in 2019 or later, and you get an error when running `gem install rails`, you need to be starting docker with a later version of Ruby than what he's doing here, with a command like `docker run --rm -it -v "$PWD:/app" ruby:2.5 bash`, or whatever version the rails website says is the current minimum latest version for ruby.

jeffmjack
Автор

Thanks - exactly what I was looking for. This is the best example of networking an app and db in Docker I ‘ve seen.

lizcooper
Автор

In case you are running Docker on Windows and you get a weird "C:\Program Files\Docker Toolbox\docker.exe: invalid reference format: repository name must be lowercase." make sure "$PWD:/usr/src/app" is surrounded by quotes (unlike in the video at 13:30).

gabrielecalvo
Автор

Shared, Liked, Subscribed. Thanks for the video, please keep making them, they are clear and concise.

CPEDGG
Автор

Great
Any chance on a tutorial on how to forward ssh key to a container, so docker can pull from private repos?

dannunziostefano
Автор

Keith, thank you very much for this tutorial, very well explained and put together! Shared, liked and subscribed a long time ago :-)

donjciii
Автор

Another great job on showing to use Docker. I did run into an issue and wanted to share. Where you had us create the welcome_controller.rb file and render the text, this didn't work on Rails 5.1.3, as it was looking for a view file for the show action and puma would throw an error. I created the file and then the page displayed correctly.

TroyMurray
Автор

Very well explained. I watched alongside learndocker.online and it was easy to understand.

Sonekkah
Автор

Thanks for the tutorial however clearly I missed something. you did not use sudo while executing docker run, then in bash you were root when you executed rails, which if you use ls -al (for me at least) makes all of the generated files owned by root. So in atom when I try to modify one of those files I can't because they are owned by root. You did not seem to have an issue, and no one else has commented so please let me know where I went wrong?

ToddEmpcke
Автор

Hi,

After following closely your tutorial (I spent 2 days on this single video), which is very hard to follow on Windows, I could manage up to here "C:\Users\ing\app\blog>docker build -t blog ."

But, I could not continue it because I got this message "'export' is not recognized as an internal or external command,
operable program or batch file.", after executing this command "export POSTGRES_USER="ing" "

You are doing good, but not for a beginners who are using Windows like myself. You jumped from one terminal to another terminal, moved from a directory to different directory without clear explanation.

There are a lot smart people like you published video tutorials, but they might not think about who the absolute beginners.

But I still thanks for your efforts to teach us.
So, please do make a very clear explanation in every step of your movement.

So, can you or any body help me to solve the above problem?

Thanks.

LiaAdzumi
Автор

Hi CoderJourney,

Your videos about dockers are superb. I don't understand the usage and context of the following command which you've ran,

docker run --rm .... -net=blog blog rake db:setup

AravindKumar-viul
Автор

Nice work, very informational content ))

VolodymyrKuchinskyi-zu
Автор

CoderJourney thanks for this video. One problem that I keep encountering is that my shared volume is owned by root which prevents other resources from accessing the files. Any advice you can throw my way?

scrambledoracle
Автор

What if I don't want to use POSTGRES but continue with sqlite3. How to write a Dockerfile then??

sameeraappana
Автор

Error response from daemon: create $PWD: "$PWD" includes invalid characters for a local volume name | 2:40

carloslora
Автор

I seem to be getting this error... Tried to find answers on google but none worked.
C:/Program Files/Docker Toolbox/docker.exe: Error response from daemon: invalid
mode:
See 'C:/Program Files/Docker Toolbox/docker.exe run --help'.

cosmic
Автор

Hi CoderJourney,

I'm having a little trouble here. The container worked at first, but I got no response in the browser. I tried to analyse the network but wasn't sure what to look for. I tried to remove the container then run it again, but I'm getting a error (That rails is server is already running).

I'm using boot2docker. And I'm not sure what the network should looks like on Virtualbox, Docker-machine and Windows (I used netstat to check for the port 3000, and wasn't there)

kelvinromero
Автор

As from rails 4.1 rails deprecated 'render text:'. Use 'render html:' instead.

patrickkuhn
Автор

Perhaps i missed a step here, but it seems you pass a db user and password and use it to create the database, but at no point to we set that user up in postgres? I just errors at that point saying role doesn't exist and I cant get my head around how you can create a db without having set up a user first?

When creating the db we should do something like CREATE ROLE new_user WITH CREATEDB CREATEROLE SUPERUSER;

bradchellingworth
Автор

Hi,
I follow your tutorial on window, everything works fine, except that when I refresh localhost:3000, it doesn't work (This site can’t be reached). Do you have any suggestion?. And where does /usr/src/app come from, I have a error relating to this in part 2(invalid bind mount spec invalid volume specification:
Thank you.

NamNguyen-sgrq