logo
0
0
Login
ci: docker build example

Docker Hello World Example Project

This is a simple Docker example project that demonstrates how to build and run a basic Ubuntu container and execute a simple script.

Project Structure

. ├── .cnb.yml # Build configuration file └── docker/ ├── Dockerfile # Docker image definition └── setup.sh # Script executed in the container

Functionality

This project creates a Docker container based on Ubuntu 18.04 and executes a simple script in the container that outputs a "hello" message.

Building and Running

Manual Build and Run

  1. Build the Docker image:
docker build -t hello-docker -f docker/Dockerfile .
  1. Run the Docker container:
docker run --rm hello-docker /app/setup.sh

Building with Configuration File

The project includes a .cnb.yml configuration file that can be used for automated build and deployment processes. This configuration specifies using docker/Dockerfile for building and uses the docker/setup.sh script during the build process.

Customization

You can customize the project by modifying the following files:

  • docker/Dockerfile: Change the base image or add more build steps
  • docker/setup.sh: Modify the operations performed when the container starts

Requirements

  • Docker