Skip to content

Commit 601450c

Browse files
committed
added steps for using Code Engine build commands
1 parent c6e603e commit 601450c

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

create-container-image.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Create Container Image
22

3+
> If you are using IBM Cloud Code Engine to run your container image and the containter registry used is the IBM Cloud Container Registry or a non-Public registry, you will be required to setup a secret for reading the image. Follow the steps outlined in here: https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registry to do just that.
4+
35
## Using Docker build commands
6+
This example is using Docker to build the image.
47

58
You will use the provided `Dockerfile`.
69
- Install docker on your machine and build the docker image
@@ -15,9 +18,32 @@ You will use the provided `Dockerfile`.
1518
> Note: If using the IBM Cloud Container registry, don't forget to use `ibmcloud cr login`
1619
1720
- Tag the image with your container registry's namespace/repository name.
18-
> Note:For IBM Cloud Container Registry in the US: `docker tag mean-stack:v1.0.0 us.icr.io/<namespace>/mean-stack:1.0.0`
21+
> Note: For IBM Cloud Container Registry in the US: `docker tag mean-stack:v1.0.0 us.icr.io/<namespace>/mean-stack:1.0.0`
1922
2023
- Push the image.
2124
> Note: For IBM Cloud Container Registry in the US: `docker push mean-stack:v1.0.0 us.icr.io/<namespace>/mean-stack:1.0.0`
2225
23-
- If you are using IBM Cloud Code Engine to run your container image and the containter registry used is the IBM Cloud Container Registry or a non-Public registry, you will be required to setup a secret for reading the image. Follow the steps outlined in here: https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registry to do just that.
26+
- If you are using IBM Cloud Code Engine to run your container image and the containter registry used is the IBM Cloud Container Registry or a non-Public registry, you will be required to setup a secret for reading the image. Follow the steps outlined in here: https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registry to do just that.
27+
28+
## Using Code Engine build commands
29+
Don't have Docker installed locally, this example uses Code Engine to build and publish the image.
30+
31+
You will use the provided `Dockerfile`.
32+
33+
- Create a registry secret to push images to the container registry you are using:
34+
```
35+
ibmcloud ce registry create --name myregistry --server <registry> --username <username> --password <apikey-access_token-password>
36+
```
37+
> Note: For IBM Cloud Container Registry: `ibmcloud ce registry create --name <secret-name>` you are prompted for your IAM APIkey value and the username is defaulted to `iamapikey`.
38+
39+
- Create a new image build:
40+
```
41+
ibmcloud ce build create --name mean-stack-local-build --build-type local --image <registry><namespace-repository>/sample --registry-secret <secret-name> --dockerfile Dockerfile --strategy dockerfile --size medium
42+
```
43+
> Note: For IBM Cloud Container Registry in the US: `ibmcloud ce build create --name mean-stack-local-build --build-type local --image us.icr.io/<namespace>/sample --registry-secret <secret-name> --dockerfile Dockerfile --strategy dockerfile --size medium`
44+
45+
- Run the build and push to the registry
46+
```
47+
ibmcloud ce buildrun submit --build mean-stack-local-build --source .
48+
```
49+

0 commit comments

Comments
 (0)