-
Notifications
You must be signed in to change notification settings - Fork 5.5k
enhance the existing Tuxedo dockerfiles #455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following files and folders under OracleTuxedo would be removed after merged.
|
This PR is actually about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review the CONTRIBUTING.md
file in the root of the GitHub repo as there are still some Golden Rules being broken. The biggest one that appears to affect all the Dockerfiles
is a lack of CMD
or ENTRYPOINT
directive in any of them.
# | ||
|
||
# Pull base image | ||
FROM oracle/tuxedo:<VERSION> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an invalid FROM
line. You'll need to make it specific.
#RUN yum -y install bind-utils | ||
|
||
USER oracle | ||
WORKDIR /u01/oracle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no CMD
or ENTRYPOINT
command, which is against the Golden Rules as stated in the contribution guide. Please provide one, even if all it outputs is documentation on how to find more information on extending this image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dockerfile is to show how to build a Tuxedo docker image. Then users coudl develop or deploy their apps on the image. Will output how to use the docker image.
#RUN yum -y install bind-utils | ||
|
||
USER oracle | ||
WORKDIR /u01/oracle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no CMD
or ENTRYPOINT
command, which is against the Golden Rules as stated in the contribution guide. Please provide one, even if all it outputs is documentation on how to find more information on extending this image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dockerfile is to show how to build a Tuxedo docker image. Then users coudl develop or deploy their apps on the image. Will output how to use the docker image.
@@ -0,0 +1,32 @@ | |||
#!/bin/sh | |||
# | |||
# This script modifies the installer scripts and response files to match the local environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of changing paths using an external script, can't you do this the standard Docker way using either --build-arg
for build time changes or -e
for runtime changes? That would be much better in terms of 3rd-party orchestration support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file will be removed.
exit | ||
fi | ||
|
||
# You may need uncomment the following lines and RP file name if you need check the RP md5sum value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of commented out code here. If you don't need it, remove it. If you need it, uncomment it and make sure it works.
|
||
WORKDIR /u01/oracle/simpappmp | ||
|
||
RUN sh -x ../simpappmp_runme.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no CMD
or ENTRYPOINT
in this sample, so it's not going to do anything at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dockerfile is for the mp sample. we will output how to run the sample through CMD/ENTRYPOINT.
WORKDIR /u01/oracle | ||
|
||
# Define ENTRYPOINT. | ||
ENTRYPOINT ["bash","/u01/oracle/simpapp_runme.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't run bash
directly. Just make sure your script is executable and has the bash
shebang line at the top.
docker build -t oracle/tuxedoshm . | ||
|
||
echo "To run the sample, use:" | ||
echo "docker run -ti -v \${Local_volumes_dir}/TuxedoVolumes/\${VERSION}:/u01/oracle/user_projects oracle/tuxedoshm /bin/bash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't suggest -ti
and running /bin/bash
. It should be run with -d
in the background and a CMD
or ENTRYPOINT
script should handle whatever process needs to be run.
@@ -0,0 +1,95 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you intend this script to be run by bash
, you need to change this to #!/bin/bash
.
then | ||
if [ "$1" = "12.1.3" ] | ||
then | ||
export TUXDIR=~/tuxHome/tuxedo12.1.3.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't $TUXDIR
set in the parent image? You shouldn't need to work out what it is downstream.
@brunoborges, yes, it's for core folder. After the PR is merged, the original folder should be removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending changes requested by @Djelibeybi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for requested changes submitted by @Djelibeybi to be applied
removed the useless file
removed the useless file
Updated following files: core/dockerfiles/12.1.3/Dockerfile core/dockerfiles/12.2.2/Dockerfile core/dockerfiles/buildDockerImage.sh core/dockerfiles/README.md core/README.md core/samples/mp/docker-compose.yml core/samples/mp/Dockerfile core/samples/mp/simpappmp_runme.sh core/samples/shm/build.sh core/samples/shm/Dockerfile core/samples/shm/simpapp_runme.sh Additions: core/dockerfiles/12.1.3: init.sh core/dockerfiles/12.2.2: init.sh core/samples/mp: simpappmp_build.sh Removals: core/dockerfiles/12.1.3: tuxedo12.1.3.rsp.template core/dockerfiles/12.1.3: tuxedo12.1.3_silent_install.sh.template core/dockerfiles: fix_locations.sh core/dockerfiles: tuxedo.docker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This latest commit has improved things, but you're still considering the containers as if they were VMs, which they're not.
You should always keep in mind that users must never be required to login into or attach to a running container. They need to be self-contained and all access is done remotely.
So, for your samples, you may need to expose some ports and explain how to test/validate the application externally.
mkdir -p /u01 && chmod a+xr /u01 && \ | ||
groupadd -g 1000 oracle && useradd -b /u01 -m -g oracle -u 1000 -s /bin/bash oracle | ||
|
||
# Copy packages | ||
# ------------- | ||
COPY tuxedo12.1.3.rsp $TUX_PKG /u01/ | ||
COPY init.sh /u01/oracle/ | ||
COPY oraInst.loc /etc/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should combine these three COPY
directives into one.
COPY oraInst.loc /etc/ | ||
RUN chown oracle:oracle -R /u01 | ||
RUN chmod +x /u01/oracle/init.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should combine these two RUN
directives into one.
echo "" | ||
echo "This image is designed as base image of Tuxedo applications, user needs to deploy applications, source codes, configuration files, and other necessary settings to the container, build source codes, boot the tuxedo domains, run the applications, and shutdown tuxedo domains. There are 2 samples: shm and mp for your reference." | ||
|
||
tail -f /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this tail. If the entire point of the image is to be used as a base for other images, you don't want it to keep running. You want it to exist automatically.
@@ -0,0 +1,6 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rewrite the following two echo
lines to:
This sample Docker image is provided by Oracle and is designed to be used as a base image from which you can build Tuxedo-based applications.
To help you get started customizing this image, we've provided two sample applications ("shm" and "mp") in the Oracle Docker Images GitHub repository. These samples demonstrate how to deploy applications, source code, configuration files and the other necessary settings to build Tuxedo-enabled application containers.
For more information on this image, please visit the Oracle Docker Images GitHub repository at https://github.com/oracle/docker-images.
For more information on Tuxedo, please read the Oracle Tuxedo documentation at http://docs.oracle.com/cd/E53645_01/tuxedo/docs12cr2/index.html.
mkdir -p /u01 && chmod a+xr /u01 && \ | ||
groupadd -g 1000 oracle && useradd -b /u01 -m -g oracle -u 1000 -s /bin/bash oracle | ||
|
||
# Copy packages | ||
# ------------- | ||
COPY tuxedo12.2.2.rsp $TUX_PKG /u01/ | ||
COPY init.sh /u01/oracle/ | ||
COPY oraInst.loc /etc/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please combine these three COPY
directives into one.
if [ "$?" = "0" ] | ||
then | ||
echo "" | ||
echo "Tuxedo Docker image is ready to be used. To create a container, run:" | ||
echo "docker run -ti -v \${LOCAL_DIR}:/u01/oracle/user_projects oracle/tuxedo:${VERSION} /bin/bash" | ||
echo "docker run -d -v \${LOCAL_DIR}:/u01/oracle/user_projects oracle/tuxedo:${VERSION} /bin/bash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not ask users to run /bin/bash
. This is a container, not a VM. The CMD
or ENTRYPOINT
script should run and that should provide the required functionality.
MAINTAINER Judy Liu<judy.liu@oracle.com> | ||
COPY simpapp_runme.sh simpappmp_runme.sh sleep.sh start_tlisten.sh /u01/oracle/ | ||
MAINTAINER Todd Little<todd.little@oracle.com> | ||
COPY simpappmp_build.sh simpappmp_runme.sh sleep.sh start_tlisten.sh /u01/oracle/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should switch to the oracle
user first (i.e. USER oracle
) and then do the COPY
so that you don't need to chown
anything. You should be able to remove those lines completely.
RUN sh -x ../simpappmp_build.sh | ||
|
||
# Define ENTRYPOINT. | ||
ENTRYPOINT ["/u01/oracle/init.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will just run the upstream init.sh
instead of running your sample. You need to create a script that actually runs your sample application, so it's useful.
Like the shm
sample, you probably want to run simpappmp_runme.sh
here.
@@ -2,4 +2,5 @@ | |||
docker build -t oracle/tuxedoshm . | |||
|
|||
echo "To run the sample, use:" | |||
echo "docker run -ti -v \${Local_volumes_dir}/TuxedoVolumes/\${VERSION}:/u01/oracle/user_projects oracle/tuxedoshm /bin/bash" | |||
echo "docker run -d --name tuxedoshm -v \${Local_volumes_dir}/TuxedoVolumes/\${VERSION}:/u01/oracle/user_projects oracle/tuxedoshm /bin/bash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not ask the user to run /bin/bash
. Your image should automatically run the appropriate script or process via CMD
or ENTRYPOINT
.
@@ -2,4 +2,5 @@ | |||
docker build -t oracle/tuxedoshm . | |||
|
|||
echo "To run the sample, use:" | |||
echo "docker run -ti -v \${Local_volumes_dir}/TuxedoVolumes/\${VERSION}:/u01/oracle/user_projects oracle/tuxedoshm /bin/bash" | |||
echo "docker run -d --name tuxedoshm -v \${Local_volumes_dir}/TuxedoVolumes/\${VERSION}:/u01/oracle/user_projects oracle/tuxedoshm /bin/bash" | |||
echo "docker start tuxedoshm; docker attach tuxedoshm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker run
command will automatically start the container. And you shouldn't need to attach to a running container at all. This line should be removed.
Rather, you probably should provide instructions on how to test/validate the application is working from outside the containers.
1. removed core/samples to tuxedo_full as the samples are dependent on TSAM which is not installed in the docker 2. removed dockerfiles and samples folders under the original Tuxedo folder (OracleTuxedo) 3. updated the files according to the new comments in PR455.
No description provided.