1
Note the error message;
DESKTOP-LTE4439+resource@DESKTOP-LTE4439 MINGW64 /c/docker/teste
$ docker-compose up
postgres is up-to-date
Starting teste_java_1 ... done
Attaching to postgres, teste_java_1
postgres | The files belonging to this database system will be owned by user "postgres".
postgres | This user must also own the server process.
postgres |
postgres | The database cluster will be initialized with locale "en_US.utf8".
postgres | The default database encoding has accordingly been set to "UTF8".
postgres | The default text search configuration will be set to "english".
postgres |
postgres | Data page checksums are disabled.
postgres |
postgres | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres | creating subdirectories ... ok
postgres | selecting default max_connections ... 100
postgres | selecting default shared_buffers ... 128MB
postgres | selecting default timezone ... Etc/UTC
postgres | selecting dynamic shared memory implementation ... posix
postgres | creating configuration files ... ok
postgres | running bootstrap script ... ok
postgres | performing post-bootstrap initialization ... ok
postgres | syncing data to disk ... ok
postgres |
postgres | WARNING: enabling "trust" authentication for local connections
postgres | You can change this by editing pg_hba.conf or using the option -A, or
postgres | --auth-local and --auth-host, the next time you run initdb.
postgres |
postgres | Success. You can now start the database server using:
postgres |
postgres | pg_ctl -D /var/lib/postgresql/data -l logfile start
postgres |
postgres | waiting for server to start....2019-08-28 10:39:41.003 UTC [40] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2019-08-28 10:39:41.021 UTC [41] LOG: database system was shut down at 2019-08-28 10:39:40 UTC
postgres | 2019-08-28 10:39:41.025 UTC [40] LOG: database system is ready to accept connections
postgres | done
postgres | server started
postgres | CREATE DATABASE
postgres |
postgres |
postgres | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgres |
postgres | 2019-08-28 10:39:41.758 UTC [40] LOG: received fast shutdown request
postgres | waiting for server to shut down...2019-08-28 10:39:41.759 UTC [40] LOG: aborting any active transactions
postgres | 2019-08-28 10:39:41.767 UTC [40] LOG: background worker "logical replication launcher" (PID 47) exited with exit code 1
postgres | 2019-08-28 10:39:41.768 UTC [42] LOG: shutting down
postgres | .2019-08-28 10:39:41.781 UTC [40] LOG: database system is shut down
postgres | done
postgres | server stopped
postgres |
postgres | PostgreSQL init process complete; ready for start up.
postgres |
postgres | 2019-08-28 10:39:41.895 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres | 2019-08-28 10:39:41.896 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres | 2019-08-28 10:39:41.900 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2019-08-28 10:39:41.920 UTC [58] LOG: database system was shut down at 2019-08-28 10:39:41 UTC
postgres | 2019-08-28 10:39:41.929 UTC [1] LOG: database system is ready to accept connections
postgres | 2019-08-28 10:40:12.914 UTC [1] LOG: received smart shutdown request
postgres | 2019-08-28 10:40:12.917 UTC [1] LOG: background worker "logical replication launcher" (PID 64) exited with exit code 1
postgres | 2019-08-28 10:40:12.928 UTC [59] LOG: shutting down
postgres | 2019-08-28 10:40:12.936 UTC [1] LOG: database system is shut down
postgres | 2019-08-28 10:42:08.891 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres | 2019-08-28 10:42:08.891 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres | 2019-08-28 10:42:08.895 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2019-08-28 10:42:08.925 UTC [21] LOG: database system was shut down at 2019-08-28 10:40:12 UTC
postgres | 2019-08-28 10:42:08.933 UTC [1] LOG: database system is ready to accept connections
postgres | 2019-08-28 10:43:36.286 UTC [1] LOG: received smart shutdown request
postgres | 2019-08-28 10:43:36.289 UTC [1] LOG: background worker "logical replication launcher" (PID 27) exited with exit code 1
postgres | 2019-08-28 10:43:36.299 UTC [22] LOG: shutting down
postgres | 2019-08-28 10:43:36.308 UTC [1] LOG: database system is shut down
postgres | 2019-08-28 10:43:45.821 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres | 2019-08-28 10:43:45.822 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres | 2019-08-28 10:43:45.824 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2019-08-28 10:43:45.845 UTC [21] LOG: database system was shut down at 2019-08-28 10:43:36 UTC
postgres | 2019-08-28 10:43:45.852 UTC [1] LOG: database system is ready to accept connections
java_1 | Usage: java [options] <mainclass> [args...]
java_1 | (to execute a class)
java_1 | or java [options] -jar <jarfile> [args...]
java_1 | (to execute a jar file)
java_1 | or java [options] -m <module>[/<mainclass>] [args...]
java_1 | java [options] --module <module>[/<mainclass>] [args...]
java_1 | (to execute the main class in a module)
java_1 | or java [options] <sourcefile> [args]
java_1 | (to execute a single source-file program)
java_1 |
java_1 | Arguments following the main class, source file, -jar <jarfile>,
java_1 | -m or --module <module>/<mainclass> are passed as the arguments to
java_1 | main class.
java_1 |
java_1 | where options include:
java_1 |
java_1 | -cp <class search path of directories and zip/jar files>
java_1 | -classpath <class search path of directories and zip/jar files>
java_1 | --class-path <class search path of directories and zip/jar files>
java_1 | A : separated list of directories, JAR archives,
java_1 | and ZIP archives to search for class files.
java_1 | -p <module path>
java_1 | --module-path <module path>...
java_1 | A : separated list of directories, each directory
java_1 | is a directory of modules.
java_1 | --upgrade-module-path <module path>...
java_1 | A : separated list of directories, each directory
java_1 | is a directory of modules that replace upgradeable
java_1 | modules in the runtime image
java_1 | --add-modules <module name>[,<module name>...]
java_1 | root modules to resolve in addition to the initial module.
java_1 | <module name> can also be ALL-DEFAULT, ALL-SYSTEM,
java_1 | ALL-MODULE-PATH.
java_1 | --list-modules
java_1 | list observable modules and exit
java_1 | -d <module name>
java_1 | --describe-module <module name>
java_1 | describe a module and exit
java_1 | --dry-run create VM and load main class but do not execute main method.
java_1 | The --dry-run option may be useful for validating the
java_1 | command-line options such as the module system configuration.
java_1 | --validate-modules
java_1 | validate all modules and exit
java_1 | The --validate-modules option may be useful for finding
java_1 | conflicts and other errors with modules on the module path.
java_1 | -D<name>=<value>
java_1 | set a system property
java_1 | -verbose:[class|module|gc|jni]
java_1 | enable verbose output
java_1 | -version print product version to the error stream and exit
java_1 | --version print product version to the output stream and exit
java_1 | -showversion print product version to the error stream and continue
java_1 | --show-version
java_1 | print product version to the output stream and continue
java_1 | --show-module-resolution
java_1 | show module resolution output during startup
java_1 | -? -h -help
java_1 | print this help message to the error stream
java_1 | --help print this help message to the output stream
java_1 | -X print help on extra options to the error stream
java_1 | --help-extra print help on extra options to the output stream
java_1 | -ea[:<packagename>...|:<classname>]
java_1 | -enableassertions[:<packagename>...|:<classname>]
java_1 | enable assertions with specified granularity
java_1 | -da[:<packagename>...|:<classname>]
java_1 | -disableassertions[:<packagename>...|:<classname>]
java_1 | disable assertions with specified granularity
java_1 | -esa | -enablesystemassertions
java_1 | enable system assertions
java_1 | -dsa | -disablesystemassertions
java_1 | disable system assertions
java_1 | -agentlib:<libname>[=<options>]
java_1 | load native agent library <libname>, e.g. -agentlib:jdwp
java_1 | see also -agentlib:jdwp=help
java_1 | -agentpath:<pathname>[=<options>]
java_1 | load native agent library by full pathname
java_1 | -javaagent:<jarpath>[=<options>]
java_1 | load Java programming language agent, see java.lang.instrument
java_1 | -splash:<imagepath>
java_1 | show splash screen with specified image
java_1 | HiDPI scaled images are automatically supported and used
java_1 | if available. The unscaled image filename, e.g. image.ext,
java_1 | should always be passed as the argument to the -splash option.
java_1 | The most appropriate scaled image provided will be picked up
java_1 | automatically.
java_1 | See the SplashScreen API documentation for more information
java_1 | @argument files
java_1 | one or more argument files containing options
java_1 | -disable-@files
java_1 | prevent further argument file expansion
java_1 | --enable-preview
java_1 | allow classes to depend on preview features of this release
java_1 | To specify an argument for a long option, you can use --<name>=<value> or
java_1 | --<name> <value>.
java_1 |
teste_java_1 exited with code 1
It generates this message after I execute the command Docker-Compose up
As you can see in the figure below he can create the images;
But failed to run my backend application which is Spring Boot.
This is the file Docker-Compose.yml
version: '3'
services:
java:
image: openjdk
volumes:
- ./dockerTest-1.0.0-SNAPSHOT.jar
command: ["bash", "-c", "java -Dspring.profiles.active=docker-demo"]
kwan:
image: postgres:11.5
network_mode: bridge
container_name: postgres
expose:
- 5432
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=root
- POSTGRES_USER=postgres
- POSTGRES_DB=root
restart: unless-stopped
I tried that way;
Docker-Compose.yml
version: '3'
services:
kwan:
image: postgres
environment:
POSTGRES_PASSWORD: "root"
ports:
- "15432:5432"
volumes:
- /home/renatogroffe/Desenvolvimento/Docker-Compose/PostgreSQL:/var/lib/postgresql/data
networks:
- postgres-compose-network
java:
build:
context: ./
dockerfile: Dockerfile
image: holaweb
networks:
- postgres-compose-network
ports:
- 80:8080
networks:
postgres-compose-network:
driver: bridge
Dockerfile
FROM openjdk
MAINTAINER Wladimir Bandeira "[email protected]"
EXPOSE 8080
WORKDIR /usr/local/bin/
COPY dockerTest-1.0.0-SNAPSHOT.jar webapp.jar
CMD ["java","-Dspring.profiles.active=docker-demo","-jar","webapp.jar"]
But it didn’t work either;
I also tried to execute with the command docker-compose up -d --force-recreate --build
, but it didn’t work either.