Each Docker container stops and exits once it doesn’t have any process or script running within the container, but what if we need it to stay running?
Also find me here:
Baeldung Author
Deepak Vohra
I am an Oracle Certified Java Programmer, and an author of more than 20 books on a range of open source technologies including Java EE, Apache Hadoop, Docker, and Kubernetes, I am an Oracle Ace (MySQL and Java). When I'm not coding, my interests include philately, and cricket.
Here's what I've written (so far):
Baeldung on Java
- All
- Persistence (2)
- Docker (1)
How to Handle “MysqlDataTruncation: Data truncation: Data too long for column”
Filed under Persistence
Learn how to fix the “com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column” exception problem.
Solving “java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver”
Filed under Persistence
Learn how to fix the java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver exception problem.
Baeldung on Ops
- All
- Docker (7)
How to Flatten a Docker Image
Filed under Docker
A Docker image is a blueprint of the applications, libraries, and software installed that can be instantiated as a container. We can “flatten” an image to reduce its size, number of constituent layers, and storage space, making it more lightweight.
How to Install NVM in a Docker Container
Filed under Docker
Node Version Manager (NVM) is a tool for managing multiple Node.js versions on a machine. Of course, we can also Dockerize this process to isolate NVM’s installation.
How to Enter a Running Docker Container With a TTY
Filed under Docker
Learn several ways of launching a TTY within a Docker container.
How to Access Docker Container From Host Using Container Name
Filed under Docker
Learn about different methods to access a Docker container by its name.
How to Set Up Docker on Windows Server
Filed under Docker
Learn how to set up Docker on a Windows Server 2022.
Executing Podman inside a Docker Container
Filed under Docker
Learn about running Podman inside a Docker container.
Unable to Access MySQL Container in Docker-Compose Setup
Filed under Docker
Learn how the MySQL client program chooses the connection method in Docker Compose.
Baeldung on SQL
- All
- SQL Queries (5)
- Database Concepts (4)
- DML (4)
- SQL Tables (3)
- Databases (2)
- DDL (2)
- SQL Joins (1)
- SQL Functions (1)
- SQL Constraints (1)
- SQL Basics (1)
Updating Rows With a Subquery Referencing the Same Table in SQL
Filed under SQL Joins, SQL Queries
Learn how to update a table based on data from that table by using an SQL subquery.
What’s the Ideal Data Type to Use When Storing Latitude / Longitude in a MySQL Database?
Filed under DDL, SQL Basics
Storing latitude and longitude data in relational databases poses some challenges due to the spatial nature of the data, as traditional numeric data types don’t lend themselves well to their related calculations. In this article, we’ll explore some options for storing geographical coordinates (latitude/longitude) in MySQL including DECIMAL and POINT. We’ll also say why you shouldn’t use FLOAT.
How to Interpret and Fix the MySQL Error 1093 – Can’t specify target table for update in FROM clause
Filed under SQL Queries, SQL Tables
When working with MySQL, we might run into “ERROR 1093 (HY000): You can’t specify target table ‘x’ for update in FROM clause”. This error typically occurs when trying to access the outer query table within a subquery in an UPDATE or a DELETE statement. We can’t do this, but there are a few ways that we can rework our query to still get what we need.
How to Fix Error 1064 When Using ALTER TABLE ADD CONSTRAINT in MySQL
Filed under DML, SQL Constraints
MySQL’s Error 1064 (42000) when using the ALTER TABLE … ADD CONSTRAINT statement could be tricky to fix. It provides very sketchy information regarding the error itself, only directing the user to check the syntax without telling what the syntax issue is.
How to Lock a Single Row in MySQL
Filed under DML
When using InnoDB in MySQL, we need to consider the rows that are locked by our queries. We may end up locking more rows than we need to, which unnecessarily blocks other queries trying to access the same rows. In this tutorial, we’ll look at how we can run SQL statements to lock only a single row.
How to Duplicate a Row in a Table Containing an Auto-Increment Field in MySQL
Filed under SQL Tables
The MySQL relational database uses its auto-increment feature to automatically generate a unique, ascending sequence of integers for a column when we add a new row of data. In this tutorial, we’ll learn how to handle duplicating rows and how MySQL prevents collisions in various arrangements.
How to Optimize All the Tables in MySQL
Filed under Databases
MySQL supports different types of storage engines, like InnoDB and MyISAM, each with their own propensity for fragmentation or other deterioration that can reduce storage allocation and performance. We can address these by optimizing these takes using a straighforward command or MySQL utility.
Getting the Size of a Table in MySQL
Filed under SQL Tables
MySQL supports different types of storage engines and these can take differing amounts of disk space to use when storing tables. Whether it is MyISAM or InnoDB, we can query MySQL to find out how much space each of our tables is taking up to better help us do capacity planning.
Determine the Database Version in SQL
Filed under Databases
Tutorial on finding database server versions for relational databases.