Create new workspace cloud9 docker
Here are the steps to create a new workspace in Cloud9 using Docker:
Prerequisites:
- You have a Cloud9 account and are logged in.
- You have Docker installed on your machine.
Step 1: Create a new workspace
- Log in to your Cloud9 account and click on the "Create a new workspace" button.
- Choose "Docker" as the workspace type.
- Enter a name for your workspace (e.g., "my-new-docker-workspace").
- Choose a Docker image (e.g., "ubuntu:latest" or "node:14").
- Click "Create workspace".
Step 2: Configure the Docker image
- In the "Configure your workspace" section, you can customize the Docker image by adding environment variables, volumes, and ports.
- For example, you can add an environment variable
NODE_ENV=development
to set the Node.js environment to development. - You can also add a volume to persist data between container restarts.
- Click "Create workspace" to create the workspace.
Step 3: Start the Docker container
- Once the workspace is created, click on the "Start" button to start the Docker container.
- The container will start, and you will see the terminal output in the Cloud9 interface.
Step 4: Access the Docker container
- You can now access the Docker container using the terminal in the Cloud9 interface.
- You can run commands, install dependencies, and write code in the container.
- You can also use the "Run" button to run a specific command in the container.
Step 5: Save and commit changes
- When you make changes to the code or dependencies in the container, you can save and commit the changes using the "Save" and "Commit" buttons.
- The changes will be persisted in the Docker image, and you can roll back to previous versions if needed.
That's it! You now have a new workspace in Cloud9 using Docker. You can use this workspace to develop and deploy your applications.