[First team development ③] Share the development environment created with Docker


Article list
[First team development ①] Hello, World! With friends [First team development ②] Build an environment with Docker [First team development ③] Share the development environment created with Docker (this article)

It is a continuation from Last time. Share the development environment created with Docker to team members through GitHub! This article is for illustration purposes, so the steps are from a team member's perspective.

(Addition) Recently, I feel that the number of people who are new to programming but want to take on the challenge of personal development has increased. So, I added some explanations such as terms and commands for beginners.

procedure

  1. Clone from the GitHub repository
  2. Docker installation (if not installed)
  3. Start Docker container
  4. Create a working branch

1. Clone from the GitHub repository

-Clone: Copy the state of files and directories

You can get the URL by visiting the GitHub repository page and clicking the "Code" button. スクリーンショット 2021-01-10 10.13.14.png Create a working directory and change to it.

Terminal


$ mkdir project_name
$ cd project_name

Mkdir: Create directory (≒ folder) ・ Cd: Move to the specified directory

If you copy the URL above and type the following command in the terminal, a folder will be created in your current location.

Terminal


$ git clone https://github.com/xxxx/xxxx.git

2. Docker installation

Install Docker suitable for the OS from Docker official page. After completing the settings, check the terminal to see if it is installed correctly.

Terminal


$ docker -v
Docker version 19.03.8, build afacb8b
$ docker-compose -v
docker-compose version 1.25.4, build 8d51620a

-v: Option to check version

3. Start Docker container

Use docker-compose to start a Docker container. -Docker-compose: A convenient tool that allows you to operate multiple containers at the same time. Imagine an octopus manipulating multiple containers with many legs.

Terminal


$cd GitHub repository name#Please move to the cloned folder
$ docker-compose up -d

-Docker-compose up: Container start command. --D: Option to start in the background.

If you can start the container normally, Access localhost: 3000 → If "Yay! You're on Rails!" Is displayed, it's OK! スクリーンショット 2021-01-10 11.22.12.png

Access localhost: 8080 → If "Welcome to Your Vue.js + TypeScript App" is displayed, it's OK! スクリーンショット 2021-01-09 21.46.03.png

[Other frequently used commands (Docker)] -$ Docker-compose stop: Stop the running container -$ Docker-compose down: Stop & delete the running container (Restore & start the container with $ docker-compose up -d again) -$ Docker-compose ps: Check the running container

4. Create a working branch

If you are referring to this article from Part 2, there should be two remote branches, main and develop. But locally there is only a main branch. So, adjust the status of your local branch to remote. -Local: Environment on your PC. -Remote: Here, it is a repository on GitHub.

Terminal


$ git branch #Check your current local branch
* main
$ git fetch #Reflect the status of the remote branch locally
$ git branch -a #Check if it is reflected
* main
  remotes/origin/HEAD -> origin/main
  remotes/origin/develop
  remotes/origin/main
$ git checkout develop #Go to develop branch
$ git branch #Confirm that a new develop branch has been created
* develop
  main

[Other frequently used commands (Git)] -$ Git stash: Temporarily save changes. Often used when switching branches. If you simply check out, the work content may be reflected halfway in other branches, so as a preventive measure. -$ Git stash apply: Reflect the stashed work contents to the current branch. -$ Git stash drop: Delete the stashed work contents

Reference site

The road from Git clone to building the environment and participating in the project (all in full)GitHub sharing method for team development beginners -How to build a vue.js development environment on Docker. Easy procedure to create with docker-compose. · Fetch remote branch locally [git fetch] [Sourcetree] -How to use "git stash" to temporarily avoid the contents before commit -Use the [Git] Stash command to temporarily save local changes

Recommended Posts

[First team development ③] Share the development environment created with Docker
[First team development ②] Build an environment with Docker
Lightweight PHP 7.4 development environment created with Docker
Debug the VSCode + Docker + PHP development environment with XDebug.
Laravel development environment construction with Docker (Mac)
Build a PureScript development environment with Docker
Create Spring Boot-gradle-mysql development environment with Docker
Build a Wordpress development environment with Docker
I tried migrating the portfolio created on Vagrant to the Docker development environment
Prepare the JVM language development environment with WSL
Build a WordPress development environment quickly with Docker
Improve the performance of your Docker development environment
Rails development environment created with VSCode and devcontainer
Wordpress local environment construction & development procedure with Docker
Create a Spring Boot development environment with docker
Docker the development environment of Ruby on Rails project
Build Java development environment with WSL2 Docker VS Code
Make the strongest Laravel development environment (Docker) Japan time
Comfortable Docker environment created with WSL2 CentOS7 and Docker Desktop
Create Chisel development environment with Windows10 + WSL2 + VScode + Docker
Pytorch execution environment with Docker
WSL2 + VSCode + Docker development environment
[Docker] Rails 5.2 environment construction with docker
Build docker environment with WSL
React environment construction with Docker
I made a development environment with rails6 + docker + postgreSQL + Materialize.
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
How to build Rails, Postgres, ElasticSearch development environment with Docker
I tried to create a padrino development environment with Docker
Rails + MySQL environment construction with Docker
Create a Vue3 environment with Docker!
Build Go development environment with WSL2 + Docker Desktop + VSCode (Remote --Containers)
One file of Docker x Laravel threat! Build a local development environment with the minimum configuration
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Ruby on Rails development environment construction with Docker + VSCode (Remote Container)
I tried to build the environment of PlantUML Server with Docker
Procedure for building a Rails application development environment with Docker [Rails, MySQL, Docker]
Build environment with vue.js + rails + docker
About the current development environment (Java 8)
Build Rails environment with Docker Compose
Create SolrCloud verification environment with Docker
How to install Pry after building Rails development environment with Docker
Build a browser test environment using Capybara in the Docker development environment
[Eclipse / github] Let's share the project created with eclipse on github For beginners
PostgreSQL environment construction with Docker (from setup to just before development)
Create Laravel environment with Docker (docker-compose)
Build jooby development environment with Eclipse
[Environment construction with Docker] Rails 6 & MySQL 8
Build a development environment for Django + MySQL + nginx with Docker Compose
[Be careful about changing the version of Xdebug! ] Create a development environment with Xdebug3 + docker + VS Code
Build Unity development environment on docker
Build docker + laravel environment with laradock
Problems I was addicted to when building the digdag environment with docker
Creating a java web application development environment with docker for mac part1
I tried to build a Firebase application development environment with Docker in 2020
[Copy and paste] Build a Laravel development environment with Docker Compose Part 2
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
Build a local development environment for Rails tutorials with Docker (Rails 6 + PostgreSQL + Webpack)
Launching the production environment with docker + rails (ver5.2) and errors that occurred
[Copy and paste] Build a Laravel development environment with Docker Compose Participation