Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: tls: oversized record received with length 20527

Open /etc/systemd/system/docker.service.d/https-proxy.conf and set up HTTPS_PROXY as http-server

[Service]
Environment="HTTPS_PROXY=http://127.0.0.1:3128"

Restart docker service

$ sudo systemctl daemon-reload
$ sudo service docker restart

Read more

How to set up Docker proxy

tls: oversized record received while trying docker pull

shapka_saita_no_domain

How to set up Docker proxy

Open file /etc/default/docker and add lines like that

export http_proxy="http://pqr.corp.xxx.com:8080/"
export https_proxy="https://pqr.corp.xxx.com:8080/"

Open file /etc/systemd/system/docker.service.d/http-proxy.conf

Environment=“HTTP_PROXY=http://pqr.corp.xxx.com:8080

Open file /etc/systemd/system/docker.service.d/https-proxy.conf

Environment=“HTTPS_PROXY=http://pqr.corp.xxx.com:8080

Restart docker service

$ sudo systemctl daemon-reload
$ sudo service docker restart

How to run BlueOak server with automatic restart on file changing

Dockerfile

Create Dockerfile with following content

FROM ubuntu
RUN apt update
RUN apt install -y yum*
RUN yum-config-manager --enable *
RUN yum -y upgrade
RUN yum -y install epel-release
RUN yum -y install nodejs
RUN yum -y install npm
RUN yum -y install git
# Upgrade nodejs.
RUN yum -y install wget
# Install and load nvm.
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
# This loads nvm.
RUN export NVM_DIR="/root/.nvm" && chmod +x $NVM_DIR/nvm.sh && $NVM_DIR/nvm.sh
# Install BlueOak.
RUN git clone https://github.com/BlueOakJS/blueoak-server.git 
RUN cd blueoak-server; npm install -g blueoak-server
RUN cd blueoak-server/examples/swagger; npm install -g nodemon
RUN cd blueoak-server/examples/swagger; npm install lodash 
RUN cd blueoak-server/examples/swagger; npm install async 
RUN cd blueoak-server/examples/swagger; npm install semver 
RUN cd blueoak-server/examples/swagger; npm install debug 
RUN cd blueoak-server/examples/swagger; npm install strip-json-comments 
RUN cd blueoak-server/examples/swagger; npm install prompt 
RUN cd blueoak-server/examples/swagger; npm install import-fresh 
RUN cd blueoak-server/examples/swagger; npm install cfenv 
RUN cd blueoak-server/examples/swagger; npm install winston 
RUN cd blueoak-server/examples/swagger; npm install stack-trace 
RUN cd blueoak-server/examples/swagger; npm install express 
RUN cd blueoak-server/examples/swagger; npm install node-statsd 
RUN cd blueoak-server/examples/swagger; npm install on-headers 
RUN cd blueoak-server/examples/swagger; npm install redis 
RUN cd blueoak-server/examples/swagger; npm install swagger-parser 
RUN cd blueoak-server/examples/swagger; npm install tv4 
RUN cd blueoak-server/examples/swagger; npm install tv4-formats 
RUN cd blueoak-server/examples/swagger; npm install config 
RUN cd blueoak-server/examples/swagger; npm install body-parser 
RUN cd blueoak-server/examples/swagger; npm install cors 
RUN cd blueoak-server/examples/swagger; npm install express-static 
RUN cd blueoak-server/examples/swagger; npm install cookie-session 
RUN cd blueoak-server/examples/swagger; npm install verror 
RUN cd blueoak-server/examples/swagger; npm install multer 
RUN cd blueoak-server/examples/swagger; npm install request 
RUN cd blueoak-server/examples/swagger; npm install jsonwebtoken 
RUN cd blueoak-server/examples/swagger; npm install base64url 
RUN cd blueoak-server/examples/swagger; npm install rsa-pem-from-mod-exp 
RUN cd blueoak-server/examples/swagger; npm install raw-body 
RUN cd blueoak-server/examples/swagger; npm install node-cache
RUN echo "sh -c 'cd /blueoak-server/examples/swagger && nodemon'" >> /etc/rc.d/rc.local
RUN echo "exit 0" >> /etc/rc.d/rc.local
RUN chmod +x /etc/rc.d/rc.local

Building

Go to directory containing the file and execute

$ sudo docker build --tag swagger-blueoak .

How to set up automatically starting program in Docker-container

How to create Docker-container with BlueOak server

How to install swagger-generator

How to install docker CE

Dockerfile reference

BlueOak

How to create Docker-container with BlueOak server

Dockerfile

Create Dockerfile with following content

FROM centos:centos7
RUN yum -y upgrade
RUN yum -y install epel-release
RUN yum -y install nodejs
RUN yum -y install npm
# Upgrade nodejs.
RUN yum -y install wget
# Install and load nvm.
RUN wget -qO- https://raw.githubusercontent.com/creationix/
    nvm/v0.32.0/install.sh | bash
# This loads nvm.
RUN export NVM_DIR="/root/.nvm" && chmod +x 
    $NVM_DIR/nvm.sh && $NVM_DIR/nvm.sh
# Install BlueOak.
RUN npm install -g blueoak-server

Building

Go to directory containing the file and execute

$ sudo docker build --tag swagger-blueoak .

How to run BlueOak server

How to install docker CE

How to install swagger-generator

Dockerfile reference

BlueOak

How to create Docker-container with swagger-codegen

Dockerfile

Create Dockerfile with following content

FROM ubuntu
RUN apt update
RUN apt -y install git wget
RUN git clone https://github.com/swagger-api/swagger-codegen
RUN apt -y install software-properties-common
RUN add-apt-repository ppa:webupd8team/java
RUN apt update
RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 
    select true" | debconf-set-selections
RUN apt -y install oracle-java8-installer
RUN export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
RUN wget http://www-eu.apache.org/dist/maven/maven-3/3.3.9/binaries/
    apache-maven-3.3.9-bin.tar.gz
RUN tar -xvzf apache-maven-3.3.9-bin.tar.gz
RUN mv apache-maven-3.3.9 opt/maven 
RUN touch build_codegen.sh
RUN echo 'export M2_HOME=/opt/maven' >> build_codegen.sh
RUN echo 'export PATH=${M2_HOME}/bin:${PATH}' >> build_codegen.sh
RUN echo 'cd swagger-codegen' >> build_codegen.sh
RUN echo 'mvn clean package' >> build_codegen.sh
RUN chmod +x build_codegen.sh
RUN /build_codegen.sh
RUN rm apache-maven-3.3.9-bin.tar.gz
RUN rm build_codegen.sh

Building

Go to directory containing the file and execute

$ sudo docker build --tag swagger-codegen .

Testing

sudo docker run --rm -v ${PWD}:/local 
    -it swagger-codegen 
    java -jar swagger-codegen/modules/swagger-codegen-cli/target/
        swagger-codegen-cli.jar generate 
    -i http://petstore.swagger.io/v2/swagger.json 
    -l go 
    -o /local/out/go

How to install docker CE

How to install swagger-generator

Dockerfile reference

shapka_saita_no_domain

Often used Docker commands

Build image

$ sudo docker build --tag image_name .

Get list of images

$ sudo docker images

Run image

$ sudo docker run imagename

Stop container

$ sudo docker stop container_id

Stop all containers

$ sudo docker stop $(sudo docker ps -a -q)

Remove image

$ sudo docker rmi -f imagename

Remove all images

$ sudo docker rmi -f $(sudo docker images -a -q)

Start container with port forwarding

$ sudo docker run -p 127.0.0.1:8888:80 imagename

Start container with shell (must be installed in the container)

$ sudo docker run -it imagename /bin/bash