Comments (6)
Are you trying to do this in a running container? If so, try connecting as root
:
docker exec -u root -it $CONTAINER_NAME bash
It looks like you're trying to do this via an entrypoint, though, and I don't think there's an (elegant) way of automating it.
Ideally, you want to avoid altering container filesystems and instead introduce changes to the underlying image. (The reason has to do with how containers use overlay filesystems to store changes to their base images. A yum install
in a container can add significantly to its physical footprint. Happy to explain this further if you like!) The ideal place for a yum install
is in the setupLinuxEnv.sh
script under the dockerfile/$VERSION
directory. The benefit is you'll now have an image that includes the added software.
If the change is a one-off, you could add sudo
to the setupLinuxEnv.sh
and then call sudo yum
in the setup script.
from docker-images.
I'm trying to keep the install scripts unchanged and therefore using the "user defined scripts. I understand how to use
yumin general in a container but would like to understand if and how to use
yum in "user defined scripts
.
from docker-images.
I get it. Without sudo
and without modifying the repository, your best bet may be the docker exec
with the -u root
option. I can't think of another way. Sorry!
from docker-images.
Change request: I understand but would it then not make sense to create the base images with the sudo
command so we could use sudo
in the custom scripts?
from docker-images.
At face value, that seems to make sense. However, you'll notice that containers are missing packages normally included in base OS installations, including editors and sudo
. It's a practice that keeps image sizes low—making them faster to transfer over networks. But it's also for security. An image isn't vulnerable to attack vectors that aren't part of the image.
One principle of containerization is that images should include everything needed to run a service and nothing more. Containers typically run at scale via automation, so there's often no requirement to edit files and, thus, no need for an editor. In the case of sudo
, the base image should (ideally) include whatever packages the service ultimately needs.
Think of entrypoints as a means of painting the walls of an apartment, whereas the build is for construction. Using entrypoints to move walls requires extra permissions (permits, inspecting the electrical/plumbing, etc.), makes a lot more mess, and annoys the neighbors. Ideally, you want to build the walls in the right place at the outset.
from docker-images.
You may also find alternative Oracle database repos better suited to your needs. If you don't want to alter the base repo/installation scripts, it includes the option of (among other things) specifying a list of RPMs as part of the image.
from docker-images.
Related Issues (20)
- Building Oracle EE arm64 on x86 with docker buildx fails
- The Oracle port has not been modified
- Can DB_DOMAIN in OracleDatabase/SingleInstance? HOT 2
- any plan to support of oracle instant client with oraclelinux 9 HOT 1
- Unable to create multiple replicas on kubernetes cluster HOT 2
- Install manually oracle-database-preinstall-19c HOT 1
- Reuse Existing Database Files When Re-creating an Oracle 19c Container HOT 4
- `Password: su: Authentication failure` error when starting the container HOT 2
- Bash environment of _oracle_ user broke. HOT 9
- Failed to connect to the specified database (ORCLCDB). HOT 3
- container-registry.oracle.com/database/enterprise:12.2.0.1-slim -e ORACLE_CHARACTERSET it does not work HOT 1
- DB oracle error [FATAL] ORA-03114: not connected to ORACLE HOT 7
- poman-desktop valumes binding problem
- Oracle 19.3 image looks too heavy
- Oracle 23.3.0 FREE build docker image error for yum install HOT 8
- Failure to start up using Kubernetes / Helm Version 21.3.0 EE / XE HOT 2
- 23.4.0 Free gets "ORA-07427: spstp: cannot change directory to dbs." error HOT 1
- Error for no such file root.sh while trying to create patched image of 21.3.0 Oracle Express Edition HOT 6
- Oracle 21c: Changing the nls_territory parameter for only one PDB container.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-images.