DEV Community

Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

2 1

Docker series (Part 13): Edit codes running in containers using Bind Mounts

The tasks we will complete in this blog

Image description

So for this assignment, we will use this repository

Let's fork it and clone it in our system. Then go to the bindmount-sample-1 folder

Image description
You can also see files within it

Image description

Oh! by the way if you don't know what is Jekyll, here it is

  1. First we will go to the folder and create a container from this image

Image description

docker container run -p 80:4000 -v $(pwd):/site bretfisher/jekyll-serve
Enter fullscreen mode Exit fullscreen mode

here we set the port from 80 to 4000

volume had set to current directory using $(pwd) . Also we used /site to specify the images volumes to be directed to local directory $(pwd)

You can know more from here

Now you can see the server up and running

Image description

Go to localhost and you can see this

Image description

  1. GO to the "Welcome to Jekyll " link Image description

You can also view this from VS code

Image description

  1. Now lets change something from this file. We are changing the title from "title: "Welcome to Jekyll!" to "title: "Welcome to Jekyll! by Mitul" and save it

If you go to the terminal, you can see changes

Image description

  1. Refresh the website page (localhost)

Image description
Done!

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay