Должен признать, что я не гуру докера, но, несмотря на то, что begin вошел в Docker из командной строки, у меня возникли проблемы:
AdminsMacBook-2:dockertest newadmin$ sudo docker-compose -f src/main/docker/app.yml up
Password:
WARNING: Found orphan containers (docker_dockertest-sonar_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Pulling dockertest-app (dockertest:latest)...
ERROR: pull access denied for dockertest, repository does not exist or may require 'docker login'
вот файл yaml из проекта:
AdminsMacBook-2:dockertest2 newadmin$ more src/main/docker/app.yml
version: '2'
services:
dockertest2-app:
image: dockertest2
environment:
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=prod,swagger
- SPRING_DATASOURCE_URL=jdbc:mysql://dockertest2-mysql:3306/dockertest2?useUnicode=true&characterEncoding=utf8&useSSL=false
- JHIPSTER_SLEEP=10 # gives time for the database to boot before the application
ports:
- 8080:8080
dockertest2-mysql:
extends:
file: mysql.yml
service: dockertest2-mysql
Вот файл Docker:
AdminsMacBook-2:dockertest2 newadmin$ more src/main/docker/Dockerfile
FROM openjdk:8-jre-alpine
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
JHIPSTER_SLEEP=0 \
JAVA_OPTS=""
# Add a jhipster user to run our application so that it doesn't need to run as root
RUN adduser -D -s /bin/sh jhipster
WORKDIR /home/jhipster
ADD entrypoint.sh entrypoint.sh
RUN chmod 755 entrypoint.sh && chown jhipster:jhipster entrypoint.sh
USER jhipster
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 8080
ADD *.war app.war