- https://store.docker.com - Images
- https://hub.docker.com - Repository/My own Images
- https://docs.docker.com/get-started/#recap-and-cheat-sheet - Introductory commands
- Docker login problem with X11 GUI stuff
- Taken from: docker/compose#6023
- I'm having the same (or a similar) issue, running docker login failing with the error message Cannot autolaunch D-Bus without X11 $DISPLAY. Having stumbled across docker/docker-credential-helpers#60 it seems as if golang-docker-credential-helpers causes the issue here. Temporarily uninstalling docker-compose including the package above allowed me to run docker login to authenticate with my docker registry.
docker
docker container --help
docker --version
docker version
docker info
docker run hello-world
docker image ls
docker container ls
docker container ls --all
docker container ls -aq
docker build -t friendlyhello . # Create image using this directory's Dockerfile
docker build --no-cache -t friendlyhello . # Create image using this directory's Dockerfile without using the cache
docker run -p 4000:80 friendlyhello # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyhello # Same thing, but in detached mode
docker container ls # List all running containers
docker container ls -a # List all containers, even those not running
docker container stop <hash> # Gracefully stop the specified container
docker container kill <hash> # Force shutdown of the specified container
docker container rm <hash> # Remove specified container from this machine
docker image ls -a # List all images on this machine
docker image rm <image id> # Remove specified image from this machine
- Login
docker login
- Tag a release
docker tag image username/repository:tag
For example:docker tag friendlyhello gordon/get-started:part2
docker tag apitax-docker-2.1.4 nopatience/middleware:2.1.4
- Push a release
docker push username/repository:tag
docker push nopatience/middleware:2.1.4
- Pull a release and build - prioritizes local over pulling from docker hub
docker run -p 4000:80 username/repository:tag
docker run -p 5080:80 nopatience/middleware:2.1.4
- Add a restart flag to the run command
docker run -d --restart unless-stopped -p 5080:80 nopatience/middleware:2.1.4
# Use an official Python runtime as a parent image
FROM ubuntu:18.04
# install our dependencies and nodejs
RUN apt-get update
RUN apt-get -y install nodejs
RUN apt-get -y install npm
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
ADD . /app
# Install any needed packages specified in requirements.txt
RUN apt-get -y install python3 python3-pip
RUN pip3 install --trusted-host pypi.python.org -r requirements.txt
RUN cd /usr/local/lib/python3.6/dist-packages/apitax/ah/web/node/node && npm install && npm run build
WORKDIR /app
# Make port 80 available to the world outside this container
EXPOSE 5080
# Define environment variable
CMD ["python3", "Middleware/middleware.py", "--web", "--debug", "--no-build"]