Skip to content

Commit

Permalink
Reference container images by full name (shuttle-hq#723)
Browse files Browse the repository at this point in the history
* chore: Reference container images by full name

This is useful for users of Podman, which isn't configured
out-of-the-box to use the `docker.io` registry. It's also a good
security practice, in case of a misconfigured default registry.

* chore: Use full image names in hardcoded DB provisioner configs
  • Loading branch information
kierendavies authored Mar 28, 2023
1 parent bdccfb1 commit ba7ab11
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#syntax=docker/dockerfile-upstream:1.4.0-rc1
ARG RUSTUP_TOOLCHAIN
FROM rust:${RUSTUP_TOOLCHAIN}-buster as shuttle-build
FROM docker.io/library/rust:${RUSTUP_TOOLCHAIN}-buster as shuttle-build
RUN apt-get update &&\
apt-get install -y curl

Expand Down
10 changes: 5 additions & 5 deletions cargo-shuttle/src/provisioner_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ fn db_type_to_config(db_type: Type) -> EngineConfig {
match db_type {
Type::Shared(SharedEngine::Postgres) => EngineConfig {
r#type: "shared_postgres".to_string(),
image: "postgres:11".to_string(),
image: "docker.io/library/postgres:11".to_string(),
engine: "postgres".to_string(),
username: "postgres".to_string(),
password: "postgres".to_string(),
Expand All @@ -344,7 +344,7 @@ fn db_type_to_config(db_type: Type) -> EngineConfig {
},
Type::Shared(SharedEngine::MongoDb) => EngineConfig {
r#type: "shared_mongodb".to_string(),
image: "mongo:5.0.10".to_string(),
image: "docker.io/library/mongo:5.0.10".to_string(),
engine: "mongodb".to_string(),
username: "mongodb".to_string(),
password: "password".to_string(),
Expand All @@ -363,7 +363,7 @@ fn db_type_to_config(db_type: Type) -> EngineConfig {
},
Type::AwsRds(AwsRdsEngine::Postgres) => EngineConfig {
r#type: "aws_rds_postgres".to_string(),
image: "postgres:13.4".to_string(),
image: "docker.io/library/postgres:13.4".to_string(),
engine: "postgres".to_string(),
username: "postgres".to_string(),
password: "postgres".to_string(),
Expand All @@ -378,7 +378,7 @@ fn db_type_to_config(db_type: Type) -> EngineConfig {
},
Type::AwsRds(AwsRdsEngine::MariaDB) => EngineConfig {
r#type: "aws_rds_mariadb".to_string(),
image: "mariadb:10.6.7".to_string(),
image: "docker.io/library/mariadb:10.6.7".to_string(),
engine: "mariadb".to_string(),
username: "root".to_string(),
password: "mariadb".to_string(),
Expand All @@ -395,7 +395,7 @@ fn db_type_to_config(db_type: Type) -> EngineConfig {
},
Type::AwsRds(AwsRdsEngine::MySql) => EngineConfig {
r#type: "aws_rds_mysql".to_string(),
image: "mysql:8.0.28".to_string(),
image: "docker.io/library/mysql:8.0.28".to_string(),
engine: "mysql".to_string(),
username: "root".to_string(),
password: "mysql".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ services:
constraints:
- node.hostname==postgres
mongodb:
image: mongo:5.0.10
image: docker.io/library/mongo:5.0.10
restart: always
networks:
user-net:
Expand Down Expand Up @@ -189,7 +189,7 @@ services:
constraints:
- node.hostname==controller
deck-chores:
image: funkyfuture/deck-chores:1
image: docker.io/funkyfuture/deck-chores:1
restart: unless-stopped
environment:
TIMEZONE: UTC
Expand Down
2 changes: 1 addition & 1 deletion extras/otel/Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG OTEL_TAG=

FROM otel/opentelemetry-collector-contrib:${OTEL_TAG}
FROM docker.io/otel/opentelemetry-collector-contrib:${OTEL_TAG}

COPY otel-collector-config.yaml /etc/otel-collector-config.yaml

Expand Down
2 changes: 1 addition & 1 deletion extras/panamax/Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PANAMAX_TAG=

FROM panamaxrs/panamax:${PANAMAX_TAG}
FROM docker.io/panamaxrs/panamax:${PANAMAX_TAG}

COPY mirror.toml /mirror/mirror.toml

Expand Down
2 changes: 1 addition & 1 deletion extras/postgres/Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG POSTGRES_TAG=

FROM postgres:${POSTGRES_TAG}
FROM docker.io/postgres:${POSTGRES_TAG}

RUN apt-get update &&\
apt-get install --yes curl python3 python3-aiohttp
Expand Down
4 changes: 2 additions & 2 deletions provisioner/tests/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ impl From<DbType> for Config<'_> {
match db_type {
DbType::Postgres => Config {
container_name: PG_CONTAINER_NAME,
image: "postgres:11",
image: "docker.io/library/postgres:11",
engine: "postgres",
port: "5432",
env: vec!["POSTGRES_PASSWORD=password"],
is_ready_cmd: vec!["exec", PG_CONTAINER_NAME, "pg_isready"],
},
DbType::MongoDb => Config {
container_name: MONGODB_CONTAINER_NAME,
image: "mongo:5.0.10",
image: "docker.io/library/mongo:5.0.10",
engine: "mongodb",
port: "27017",
env: vec![
Expand Down

0 comments on commit ba7ab11

Please sign in to comment.