- Install Docker Desktop
Because we already have an official CockroachDB docker image, we will use that in our docker-compose.yml
file. We recommend you use one of the current tags instead of latest
.
import urllib | |
import urlparse | |
def iri_to_uri(iri, encoding='Latin-1'): | |
"Takes a Unicode string that can contain an IRI and emits a URI." | |
scheme, authority, path, query, frag = urlparse.urlsplit(iri) | |
scheme = scheme.encode(encoding) | |
if ":" in authority: | |
host, port = authority.split(":", 1) | |
authority = host.encode('idna') + ":%s" % port |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import Session | |
from myapp.models import BaseModel | |
import pytest | |
@pytest.fixture(scope="session") | |
def engine(): | |
return create_engine("postgresql://localhost/test_database") |
package main | |
import ( | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
"math/big" | |
) |
Because we already have an official CockroachDB docker image, we will use that in our docker-compose.yml
file. We recommend you use one of the current tags instead of latest
.
import React, { useState, useEffect } from 'react' | |
import { useDebounce } from './use-debounce' | |
const MySearchComponent = props => { | |
const [search, setSearch, { | |
signal, | |
debouncing | |
}] = useDebounce('') | |
const [results, setResults] = useState([]) |
FROM python:3.9-slim AS install | |
RUN apt-get update \ | |
&& apt-get upgrade -y \ | |
&& apt-get install -y --no-install-recommends curl \ | |
&& apt-get autoremove -y | |
RUN pip install --upgrade pip | |
WORKDIR /app/ | |
# install poetry and keep the get-poetry script so it can be reused later. | |
ENV POETRY_HOME="/opt/poetry" | |
RUN curl https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry.py |
Here's how I configured a GitHub Action so that a new version issued by GitHub's release interface will build a Dockerfile, tag it with the version number and upload it to Google Artifact Registry.
Before you attempt the steps below, you need the following: