CODEFRESH.IO DOCUMENTATION

Codefresh is a Docker-native CI/CD platform.

Instantly build , test and deploy Docker images.

Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Build Your First Docker Image

Create your first Docker image by adding a service to Codefresh. A service includes a repository and a Dockerfile.

To build your first Docker image, the first step is to add a service to Codefresh. The service consists of a service's repository and a Dockerfile or codefresh.yml.

What's a Dockerfile? Learn more at the Docker Documentation Center.

What's a codefresh.yml? Learn more at the Introduction Codefresh YAML

1. Add a service

To start building your first Docker image, you need to add a service.

Procedure:

  • Click ADD SERVICE.
Add a service (click image to enlarge)

Add a service (click image to enlarge)

2. Select a repository

Add the repository for the service you're adding

Procedure:

  1. In the search box, type the name of the repository.

Don't see your private repositories?

Try the following:

  • Started your free trial, so you can add private repositories.
  • If the free trial finished you can upgrade your account or contact us to extend the free trial.
  • Visit our Troubleshooting Center

Can't find your repository?

Try the ADD BY URL option.

  1. From the drop-down menu, select a branch for the first build.
  2. Click NEXT.

3. Select the build method

On this screen you can choose one of the build methods: codefresh.yml, Dockerfile or Codefresh template.

Procedure:

Click SELECT for chosen build method.

3.1 Codefresh.yml build method

If you chose the codefresh.yml build method, you need to do the following on this screen:

Procedure:

  1. Enter the path to codefresh.yml
    By default, Codefresh searches for your codefresh.yml at the root level of your repository, by the name codefresh.yml. In case that your codefresh.yml is in sub-directory, provide the path as well (./foo/bar/codefresh.yml).
  2. Click NEXT

More information about codefresh.yml you can read here. Also you can look at the list of codefresh.yml examples

3.2 Dockerfile build method

If you chose the Dockerfile build method, you need to do the following on this screen:

Procedure:

  1. Enter the path to Dockerfile
    By default, Codefresh searches for your Dockerfile at the root level of your repository, by the name Dockerfile. In case that your Dockerfile is in sub-directory, provide the path as well (./foo/bar/Dockerfile).
  2. Enter the path to build context
    Build context is where we can find your Dockerfile as well as running commands. Your Dockerfile must be relative to this directory.
  3. Enter image name
  4. Click NEXT

3.3 Template build method

If your repository doesn't include a Dockerfile, that's okay, you can use one of our predefined Dockerfiles!

Procedure:

  1. Choose the necessary platform
  2. Click NEXT

4. Review Your Dockerfile or codefresh.yml

After you add a Dockerfile/codefresh.yml, Codefresh displays the Dockerfile/codefresh.yml contents.

Review the Dockerfile/codefresh.yml, and when you're done, click Create.

Review Dockerfile (click image to enlarge)

Review Dockerfile (click image to enlarge)

5. Build your Docker Image

GREAT! Now that you added your service to Codefresh, you're ready to build your Docker image.

  • Click BUILD.

Build Your First Docker Image

Create your first Docker image by adding a service to Codefresh. A service includes a repository and a Dockerfile.