You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: create-container-image.md
+28-2Lines changed: 28 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
# Create Container Image
2
2
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
+
3
5
## Using Docker build commands
6
+
This example is using Docker to build the image.
4
7
5
8
You will use the provided `Dockerfile`.
6
9
- Install docker on your machine and build the docker image
@@ -15,9 +18,32 @@ You will use the provided `Dockerfile`.
15
18
> Note: If using the IBM Cloud Container registry, don't forget to use `ibmcloud cr login`
16
19
17
20
- 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`
19
22
20
23
- Push the image.
21
24
> 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`
22
25
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:
> 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 .
0 commit comments