data:
image: ubuntu
volumes:
- /root/.m2
server:
image: maven:3-jdk-8
volumes:
- ./:/app
volumes_from:
- data
working_dir: /app
ports:
- "8000:8000"
command: "/bin/bash"
docker run -d -p 5000:5000 --restart=always --name registry registry:2
docker-compose run package
docker build -t localhost:5000/sample_prod .
docker push localhost:5000/sample_prod
docker stop preview
docker rm preview
docker run -d -p 8000:8000 --name preview localhost:5000/sample_prod
docker login -e [email protected] -p testpass -u testuser
docker-compose run package
docker build -t localhost:5000/sample_prod .
docker push localhost:5000/sample_prod
ssh jenkins@localhost ' \
docker stop prod && \
docker rm prod && \
docker run -d -p 8800:8800 --restart always --name prod localhost:5000/sample_prod \
'