Step 7: Test the Docker Image
Now that the Docker image is created, you must test the Docker image using the Docker run command. The Docker run command differs slightly for a root user and a non-root user. (The Docker run command executes the startall.sh script.)
Procedure
-
To test the docker image, execute the Docker
run command depending on whether you are a root or a non-root user. See the sample provided in the following table.
User RUN Command Sample Root User docker run -it --rm -p 46464:46464 -p 56565:56565 -p 58585:58585 -v /persiststorage:/psupersist:z library/psu8.0.1 Non-root User docker run -it --rm docker run -it --rm -p 46464:46464 -p 56565:56565 -p 58585:58585 -u mftuser:mftuser -v /persiststorage:/psupersist:z library/psu8.0.1 The following table describes the parameters in the run command:Parameter Descriptions -p 46464:46464 -p 56565:56565 -p 58585:58585 Maps the ports used by the container to the ports accessible by the network -u mftuser:mftuser Defines the user ID and group ID used by the container. This is required only when running the container as a non-root user. The user defined in this command must match the user created in the dockerfile. -v /psupersiststorage:/psupersist:z: Defines the persistent storage used by the container. This storage is used for saving critical files across container restarts. The persistent storage defined must match the persistent storage directory defined in the startall.sh script. -library/psu8.0.1 Defines the name of the docker image.
Copyright © 2022. Cloud Software Group, Inc. All Rights Reserved.